OS Foundations and Process Model
Trace identity, parenthood, exit and reaping. A syscall privilege transition can return to the same process.
1 / 5
Trace identity, parenthood, exit and reaping. A syscall privilege transition can return to the same process.
Fork creates a child identity; exec replaces a program image. Exit leaves zombie bookkeeping; wait reaps a zombie child. The simulator models fork/exit/wait, not scheduling or exec.
Create2 under1; create3/4 under2; exit3; exit2. 2 is zombie under1; 3 is zombie under1; 4 remains live under1. Wait(1) returns2 then3, then-1. Never leave an exited child attached to a subsequently removed parent.
Each child parent field and its parent child-set must agree. Adoption updates the child, the old parent and init. Wait removes one PID from the table and parent set. PID reuse is outside this model.
Create2/3 under1; exit3 then2. What are two waits, Fork(2), then Fork(1)? Explain PID selection versus exit order; revisit the answer in the lesson.