Lecture3 Process Management
Lecture3 Process Management
COMP304
Operating Systems (OS)
Hakan Ayral
Lecture 3
• Reading
– Chapter 3.1-3.4 from textbook – Very Good!
– Linux Kernel Development – Chapter 3
• Multiprogramming enables
– N programs to be space-muxed in executable memory, and
time-muxed across the physical machine processor.
executing Interrupt
idle executing
Interrupt
• Switching between threads of a single process can be faster than between two
separate processes
Operating Systems-COMP 304 11
Context Switch
parentWorks(..);
wait(…);
...
Operating Systems-COMP 304 19
Process Creation
• Address space
– Child duplicates the address space of the parent
– Child has a program loaded into it
• UNIX examples
– fork() system call creates a new process
– exec() system call is used after a fork() to replace the process’ memory
space with a new program
• Acknowledgments
– Original slides are by Didem Unat which were adapted from
• Öznur Özkasap (Koç University)
• Operating System and Concepts (9th edition) Wiley
22