# fork, exec and wait

Week 3 · Processes · Operating Systems
The page also has an interactive playground: https://alfonsocampodonico.com/classes/operating-systems/fork?lang=en
Code: https://github.com/AlfonsoCampodonico/os-playground/tree/main/src/sim (`gh repo clone AlfonsoCampodonico/os-playground`)

> Write a program with fork() and watch the process tree grow, zombies and orphans included.

fork() duplicates the calling process: two processes continue from the same line. Watch the process tree, the PIDs, the order of printf output, and what happens when a parent does not wait for its child.

**OSTEP:** chapter 5, and the playground reproduces its `fork.py` homework simulator, seed for seed.

The playground above keeps its whole setup in the URL, so a link to this page reproduces the exact example. Change the inputs, step through it, and share the link.
