Processes & Threads
Create, coordinate and inspect processes and threads on Linux, and choose between them for a given workload.
4 objectives 6 steps about 135 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Describe a process's address space, states and kernel bookkeeping, and inspect them with ps, top and /proc/<pid>.
- Write programs that create and manage child processes with fork, exec and wait, without leaving zombie or orphaned processes.
- Coordinate processes with signals and pipes, including handling SIGINT, SIGTERM and SIGCHLD safely.
- Create threads with pthreads, explain what threads share and what they own, and compare the cost of threads and processes.
Lesson plan
6 steps, about 135 min · 0 of 5 lessons available so far
- Anatomy of a process: address space, descriptors and states Concept · 20 min · coming later
- Lab: watch processes live with ps, top and /proc/<pid> Lab · 20 min · coming later
- The fork-exec-wait pattern and the life of a zombie Worked example · 25 min · coming later
- Lab: signals and pipes - a two-process pipeline built by hand Lab · 30 min · coming later
- Threads: shared memory, private stacks and what clone() creates Concept · 20 min · coming later
- Check: process-control scenarios and a fork vs thread benchmark Knowledge check · 8 questions
Practise it
Write a C program runpar that runs N shell commands in parallel child processes, forwards SIGINT to all children, reaps every child and prints each exit status; then rebuild the worker pool with pthreads and compare start-up cost for 1,000 tasks.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own ShellIntermediate · 8–16 h
- Build your own DebuggerAdvanced · 15–30 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.