Operating System - Process Scheduling Flashcards
Maximise CPU use
Quickly switch processes onto CPU for time sharing
Under what condition does the process “gives” up the CPU?
- I/O requests
-After N units of time have elapsed
Ready Queue
Once a process gives up the CPU it is added to a ready queue
Progress scheduler
Selects among available processes in the ready queue for next execution on CPU
Queing diagram
Represents queue, resources, flows
Job queue
Set all processes in the system
Ready Queue
Set of all processes residing in main memory, ready and waiting to execute
Device queues
Set of processes waiting for an I/O device
How are the scheduling queues maintained
The operating system maintains scheduling queues of processes.
Processes migrate among the various queues.
Short-term scheduler (cpu scheduler)
Selects which process should be executed next and allocates a CPU
Sometimes the only scheduler in the program
Is invoked frequently (milliseconds) must be fast
Long-term scheduler (Job scheduler) selects which processes should be brought into the ready queue
Long-term scheduler is invoked infrequently(seconds, minutes) => may be slow
The long-term scheduler controls the degree of multiprogramming
Types of processes
-I/O bound process - spends more time doing I/O than computations, many short CPU bursts
-CPU-bound process - spends more time doing computations, few very long CPU bursts
Context Switch
When the CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch
Dispatch Events
The events which will cause the OS to switch from one process to another