CS 240 Lab 10

Learning Goals & Reflection

CS 240 Lab 10

Learning Goals

Core Goals

Students can:

  1. Explain what a process is:
    1. Explain how multiple processes can run “at the same time” on a single CPU.
    2. Explain what an “interrupt” is.
    3. Explain at a very high level how the physical RAM of the computer is shared between multiple processes.
  2. Use Linux command-line tools for managing processes:
    1. Use top or ps to list processes.
    2. Read files in the /proc folder to find out stats about processes.
  3. Understand how the fork function works in C:
    1. Explain what it means that you “call fork once but it returns twice.”
    2. Describe the return value from fork and how it differs between the parent and child processes.
    3. Predict the output from short programs that use fork, including how many processes will be created and when the shell will assume the process is done and print the next input prompt.
    4. Identify whether a program is a “fork bomb” by reading the source code without running it.
    5. Explain why the order in which processes will run is unpredictable.

Stretch goals

  1. Use Linux command-line tools for managing processes:
    1. Use control-C, kill, and/or killall to stop processes.
    2. Use control-Z and the jobs, fg, and bg commands to pause and manage foreground and background processes.
  2. Understand how the fork function works in C:
    1. Identify a few different options for communication between processes that need to coordinate work.

Reflection

Note: Make sure to use the ‘print’ dialog to save this page as a PDF when you’re done.

I’m most confident in (list a few):

I’m least confident in (list a few):

Questions (please take the time to ask at least one, thinking of a question will help you cement what you’ve learned):