Process Management Flashcards
What is Multitasking?
Two or more programs active with interleaved execution
What is Multiprocessing?
A computing environment with multiple processors
What is a Program?
A series of instructions (static)
What is a Process?
- A program with its execution state (dynamic)
- You can have many processes all executing the same
program with different state
Outline the life of a process.
- Process is created
- Cycles between CPU bursts and I/O bursts
- Process ends
What is the 5 State model?
New:
- The OS is creating the PCB and allocating initial resources to the process
Ready:
- The process is waiting for its turn to use the CPU
Running:
- The process is running on the CPU
Blocked:
- The process is waiting for some event to happen
(I/O, timer, child to end, interrupt)
Exiting:
- The OS is reclaiming the process’ resources and notifying its parents
What are the 2 kinds of scheduling?
Nonpreemptive and Preemptive
What is Preemptive scheduling?
- The OS decides when a process has had enough CPU time
- Packages up the state of the process and moves the process to the
ready queue
- The transition is undetectable to the process
What is Nonpreemptive scheduling?
- The process decides when its computations are in a stable state to
give up the CPU ( Eg. System call )
- Uncommon today
What is a context switch?
The event of saving the state of a process in the
running state to its PCB and of restoring the state of
another process from its PCB to the hardware.
Implications:
- Empty hardware caches
- Flush instruction pipelines
- Stop all look-ahead processing
Common Schedulers
Short term scheduler:
- Determines who will execute next – orders the ready queue
- Executed frequently
Long term scheduler:
- Determines when a process can transition from new to ready
- Tries to ensure a good mix if CPU-bound and I/O-bound processes
Less Common Schedulers
Dispatcher:
- The code that actually does context switches
- If no dispatcher then the short term scheduler does the context switch
Medium term scheduler:
- Monitors the performance of the system and can temporarily
remove processes from the ready queue and/or adjust resources
seen by the long term scheduler to ensure good system
performance