Download presentation
Presentation is loading. Please wait.
Published byPatrick Gregory Modified over 9 years ago
1
Process Management Jerrod Howlett Sarah Sullivan
2
Processes Process- a program in execution Process Control Block (PCB)- how a process is represented in an OS process state program counter CPU registers CPU scheduling information memory management information accounting information I/O status information
3
Process States
4
Process Creation fork() defined by API Uses clone() system call -> do_fork() -> copy_process() If successful, then it will wake the new child being created. Child is run in the kernel, preventing copy_on_write overhead, if exec() is called immediately. vfork() Same as fork(), but does not copy parent page table entries. Parent is blocked until child calls exec() or exits.
5
Copy-On-Write fork() is implemented through the use of copy- on-write (COW) pages Technique to delay or altogether prevent copying of data So that data that isn't shared isn't copied, preventing unnecessary overhead If data is written to, a duplicate is made, and each process receives a unique copy. Duplication only occurs when something is written. Otherwise, data is shared as read-only.
6
Process Termination Done either voluntarily or by the exit() system call Work is done by do_exit() No longer runnable No address space TASK_ZOMBIE state Exists solely to provide information for the parent Exits TASK_ZOMBIE state when parent receives info from child, or is no longer interested in the child Need to re-parent if parent exits before child Won't be a zombie Either gets re-parented to another process or an init process
7
Acknowledgements Linux Kernel Development, 2 nd Edition (2005) Linux Cross-Reference http://lxr.linux.no/ kernel\fork.c include\linux\sched.h
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.