Operating Systems Process Creation(3) e Address space Child duplicate of parent.子女复制双亲 Child has a program loaded into it.子女有一个程序被调入 g UNIX examples H fork system call creates new process H execve system call used after a fork to replace the process'memory space with a new program 在fork用一个新程序替代了进程的内存空间之后,采用 execve系统 调用 Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 8 Process Creation (3) Address space Child duplicate of parent. 子女复制双亲 Child has a program loaded into it. 子女有一个程序被调入 UNIX examples fork system call creates new process execve system call used after a fork to replace the process’ memory space with a new program. 在fork 用一个新程序替代了进程的内存空间之后,采用execve系统 调用
Operating Systems Process Termination Conditions which terminate processes Normal exit(voluntary) 2. Error exit( voluntary)(错误退出) 3. Fatal error( involuntary)(严重错误) 4. Killed by another process(involuntary) Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 9 Process Termination Conditions which terminate processes: 1. Normal exit (voluntary) 2. Error exit (voluntary) (错误退出) 3. Fatal error (involuntary) (严重错误) 4. Killed by another process (involuntary)
Operating Systems Process Termination(2) g Process executes last statement and asks the operating system to decide it(exit). H Process'resources are deallocated(再分配) by operating system e Parent may terminate execution of children processes (abort). a Child has exceeded allocated resources.超量分配资源 Task assigned to child is no longer required H Parent is exiting. Operating system does not allow child to continue if its parent terminates Cascading termination.级联终止 Gao Haichang, Software School, Xidian University 10
Operating Systems Gao Haichang , Software School, Xidian University 10 Process Termination (2) Process executes last statement and asks the operating system to decide it (exit). Process’ resources are deallocated (再分配) by operating system. Parent may terminate execution of children processes (abort). Child has exceeded allocated resources. 超量分配资源 Task assigned to child is no longer required. Parent is exiting. ➢ Operating system does not allow child to continue if its parent terminates. ➢ Cascading termination. 级联终止
Operating Systems Process Hierarchies c Parent creates a child process, child processes can create its own process, forms a hierarchy(层次关系) H UNIX calls this a " process group Windows has no concept of process hierarchy H all processes are created equal Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 11 Process Hierarchies Parent creates a child process, child processes can create its own process, forms a hierarchy (层次关系) UNIX calls this a “process group” Windows has no concept of process hierarchy all processes are created equal