Context Switch: When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch Context of a process represented in the PCB Context-switch time is overhead; the system does no useful work while switching Time dependent on hardware support Process Creation: Parent process create children processes, which, in turn create other processes, forming a tree of processes Generally, process identified and managed via a process identifier (pid) Resource sharing Parent and children share all resources Children share subset of parent’s resources Parent and child share no resources Execution When a process creates a new process, two possibilities for execution exist: Parent and children execute concurrently Parent waits until children terminate Process Creation (Cont): Address space There are also two address-space possibilities for the new process: Child duplicate of parent (it has the same program and data as the parent). Child has a program loaded into it UNIX examples fork system call creates new process
Context Switch: When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch Context of a process represented in the PCB Context-switch time is overhead; the system does no useful work while switching Time dependent on hardware support Process Creation: Parent process create children processes, which, in turn create other processes, forming a tree of processes Generally, process identified and managed via a process identifier (pid) Resource sharing Parent and children share all resources Children share subset of parent’s resources Parent and child share no resources Execution When a process creates a new process, two possibilities for execution exist: Parent and children execute concurrently Parent waits until children terminate Process Creation (Cont): Address space There are also two address-space possibilities for the new process: Child duplicate of parent (it has the same program and data as the parent). Child has a program loaded into it UNIX examples fork system call creates new process
O.S%20Ch%2003.docx