Process Scheduling Algorithms Flashcards
In process scheduling, each algorithm encompasses a … that determines which process among the ready processes is selected next for execution, and a … that specifies that instants in time at which the selection function is exercised.
selection function, decision mode
Once a process is in the Running State, it continues to execute until it terminates or it blocks itself to wait for an I/O operation or request some OS service
Non-preemptive
The currently running processes may be interrupted and moved to the Ready State by the OS.
The decision to preempt may be performed during the following circumstances:
- A new process arrives
- An interrupt occurs that places a blocked process in the Ready State
Preemptive
This algorithm is easy to implement in batch systems, where the required CPU time is known is advance. On the other hand, this algorithm is impossible to implement in interactive systems where the required CPu time is unknown. It is the best approach to minimize the waiting time.
Shortest Job First (SJF)
In this algorithm, all incoming processes join the ready queue. Then, if the currently running process ceases to execute, the process that has been in the ready queue the longest is selected for running.
FCFS performs better for long processes. It is not an appealing alternative on its own for a uniprocessor system. However, it is often combined with priority scheme to provde an effective scheduler.
First-Come First-Serve (FCFS)
In this algorithm, when a new process with a shorter remaining time joins the ready queue, the scheduler may preempt the currently running process and execute the new one.
The scheduler must have an estimate of the processing time to perform the selection function. In addition, the risk of starvation of long processes exists.
Shortest Remaining Time First (SRTF)
This algorithm involves the generation of a clock interrupt at periodic intervals. When the interrupt occurs, the currently running process is placed in the ready queue, and the next ready job is selected on a first-come first-serve basis.
This technique is known as time slicing, because each process is given a slice of time before being preempted.
Round Robin (RR)
In general, each systems process is assigned with corressponding priority, and the scheduler will always choose a process of higher priority.
A particular challenge exists in implementing a pure priority-based scheduling, and that is: loer priority processes may suffer starvation.
Non-Preemptive Priority (NPP) Scheduling