G53OPS - Operating Systems

This course is run at the The University of Nottingham within the School of Computer Science & IT. The course is run by Graham Kendall (EMAIL : gxk@cs.nott.ac.uk)


Pre-emptive Scheduling

A simple scheduling algorithm would allow the currently active process to run until it has completed. This would have several advantages

1. We would no longer have to concern ourselves with race conditions as we could be sure that one process could not interrupt another and update a shared variable.
2. Scheduling the next process to run would simply be a case of taking the highest priority job (or using some other algorithm, such as FIFO algorithm).

Note : We could define completed as when a process decides to relinquish control of the CPU. The process may not have completed but it would only relinquish control when it was safe to do so (e.g. not in the middle of updating a shared variable).

But the disadvantages of this approach far outweigh the advantages.

· A rogue process may never relinquish control, effectively bringing the computer to a standstill.
· Processes may hold the CPU too long, not allowing other applications to run.

Therefore, it is usual for the scheduler to have the ability to decide which process can use the CPU and, once it has had its slice of time then it is placed into a ready state and the next process allowed to run.

This type of scheduling is called preemptive scheduling.

This disadvantage of this method is that we need to cater for race conditions as well as having the responsibility of scheduling the processes.

Last Page Back to Main Index Next Page


 


 Last Updated : 13/01/2002