Multitasking
Multitasking : Concurrent execution of multiple tasks/processes
Time multiplexing of CPU
-Creates impression of parallelism
-Even on single core/CPU system
Allows for asynchronous I/O
-I/O devices and CPU are truly parallel
-10ms waiting for HDD allows other processes to execute >10^10 instructions
Process context
-A process is (essentially) a program executing inside an OS
-Each running instances of a program (e.g., multiple browser windows) is a separate process
-Each process has a context
• Instruction counter
• Values in registers, stack and heap
• Resource handles (device access, open files)
Process management
- Processes need resources: CPU time, Memory, etc.
-Operating system manages processes:
• Starts processes
• Terminates processes (frees resources)
• Controls resource usage (prevents monopolizing CPU time)
• Schedules CPU time
• Synchronizes processes if necessary
• Allows for inter process communication