Linux & OS Internals
fork exec wait
Explain how fork and exec create a new program, how the parent collects the child's status, and why an inherited descriptor can keep a port or pipe open.
What you will be able to do
- Explain what fork and execve each do to the PID and file descriptors.
- Decide which descriptors a child should keep, and set close-on-exec on the rest.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Linux & OS Internals
- Mount namespacesBeginner · 4 min
Mount namespaces provide isolated filesystem mount views.
- Process lifecycleBeginner · 4 min
Explain how a process moves from creation to exit, why an exited child can stay as a zombie until its parent calls wait, and how orphans are handled.
- Threads and pthreadsIntermediate · 4 min
Explain how threads share a process's memory and descriptors, why shared memory needs locks, and why a higher thread count does not speed up lock-bound work.
- CPU scheduling classesIntermediate · 4 min
Explain how Linux picks the next thread by scheduling class, why real-time policies outrank normal ones, and what nice values change inside the normal class.
- Context switchingIntermediate · 4 min
Explain what a context switch costs in CPU time, how voluntary and nonvoluntary switches differ, and how to read switch rates against a healthy baseline and the request…
- Run queuesIntermediate · 4 min
Explain how the run queue holds ready tasks, how CFS picks the next one by virtual runtime, and why a long queue adds latency even when CPUs are not fully busy.