🔬 Lab
CS 240 Lab 11
Learning Goals & Reflection
CS 240 Lab 11
Learning Goals
Core Goals
Students can:
- Explain what a process is:
- Explain how multiple processes can run “at the same time” on a single CPU.
- Explain what an “interrupt” is.
- Explain at a very high level how the physical RAM of the computer is shared between multiple processes.
- Use Linux command-line tools for managing processes:
- Use
top
orps
to list processes. - Read files in the
/proc
folder to find out stats about processes.
- Use
- Understand how the
fork
function works in C:- Explain what it means that you “call
fork
once but it returns twice.” - Describe the return value from
fork
and how it differs between the parent and child processes. - 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. - Identify whether a program is a “fork bomb” by reading the source code without running it.
- Explain why the order in which processes will run is unpredictable.
- Explain what it means that you “call
Stretch goals
- Use Linux command-line tools for managing processes:
- Use control-C,
kill
, and/orkillall
to stop processes. - Use control-Z and the
jobs
,fg
, andbg
commands to pause and manage foreground and background processes.
- Use control-C,
- Understand how the
fork
function works in C:- Identify a few different options for communication between processes that need to coordinate work.
Reflection
Fill out the CS 240 Lab 11 Reflection form to complete today’s lab reflection.