Processes
2026-10-06
Which of these are elements of a page table entry structure that might be stored in a TLB?
This module: Unix abstractions
(Yes, some overlap with 3410/4410.)
An instance of a program in execution
Kernel-maintained PCB data structure tracks
and more!
Processes run in user mode; kernel takes control when
Crossing kernel boundary is not free!
Thread \(<\) process!
Two phases to launch a new program (C interface):
fork for new process
exec to start new programRust does a combination.
std::process::Command is a builder
Commandspawnoutput or statusarg or argsenv, envs, env_clear, env_removeCommand methods set stdin, stdout, stderrStdio object built from
Stdio::inherit() - inherit from parentStdio::piped() - set up a pipeStdio::from(file) - connect to a fileChild has stdin, stdout, stderr fields
take() to connect to something elselet mut child = Command::new("ls") // the program to run
.arg("-la") // add one argument (or .args([...]))
.stdout(Stdio::piped()) // Prep for standard output
.spawn()?; // fork + exec, returns a Child handle
// --
// Try to set up another subprocess to read, and it fails to launch...
// --
let mut sink = std::io::sink();
let mut stdout = child.stdout.take();
std::io::copy(&mut stdout, &mut sink); // IMPORTANT!
let status = child.wait()?; // block until it finishesWhy is that line important?
std::process::Commandstd::os::unix::process::CommandExt methodswait on child to complete and get code
What if parent exits without wait on children?
SIGCHLD handlerWhy should crates like zerocopy disallow references in mapped data structures?
Respond at: https://PollEv.com/davidbindel252 or send davidbindel252 to 22333
A signal notifies the process of a system event
killOf course, this matters for benchmarking…
renice adjusts niceness of running processtasksetNeed to handle many possible errors:
Broad problem: partial failure
Writers block when out of buffer
How do you feel about today’s lecture?
Respond at: https://PollEv.com/davidbindel252 or send davidbindel252 to 22333
On Ed: If you are having trouble with PollEv after this lecture, please post on today’s Ed thread (and try to help us figure it out before Thu).