– The scheduling disciplines or the algorithms are used wherever operating systems are involved.
– This is so because the CPU time has to be allotted to the processes and threads.
– In routers they are used for handling the traffic.
– Other devices where scheduling disciplines are used are embedded systems, printers, disk drives and so on.
About Fixed Priority Preemptive Scheduling
– In this scheduling algorithm, a rank with fixed priority is assigned to all the processes demanding the CPU time.
– Then based up on their priority, these processes are lined up in the ready queue by the scheduler.
– If a process is in execution and there is an incoming process with a higher priority, then the executing process is interrupted.
– There are many characteristic features of fixed priority preemptive scheduling which we shall mention below:
- The overhead is neither significant nor it is minimal.
- This scheduling discipline does not offer any particular advantage over FIFO scheduling when it comes to the overall throughput.
- The priority of the process is directly related to the response time and the waiting time of the process. This is why the processes with higher priority will always have a higher priority.
- Usually for meeting deadlines, a higher priority is assigned to the processes with deadlines.
- In FPPS also there are possibilities of starvation in processes with lower priorities if there is a continuous incoming of high priority processes.
Where this algorithm used?
– Real time operating systems are where this scheduling discipline is commonly used.
– This algorithm is useful in ensuring that at any given instant of time, the process with highest priority is executed out of all the processes in the ready queue.
– This scheduling algorithm is based up on a preemptive scheduler.
– This scheduler comes with a clock interrupt task whose task for providing the scheduler with the options for switching after a time slice has been allocated to the task.
– The basic advantage of this scheduling algorithm is that it makes sure that any process does not hold the CPU for a time longer than its time slice.
– The disadvantage is that the thread or process lockout makes this scheduling system algorithm.
– Since the higher priority tasks are always the first to be executed, this means there is an indefinite waiting for the processes with lower priority.
– One common solution for this problem is aging.
– In this method after a certain period of time the priority of the waiting threads and processes is incremented.
– This way it makes sure that all the processes are eventually executed.
– Most of the real time operating systems come with preemptive schedulers.
– Here, if the time slicing feature is removed, you will the non–preemptive scheduling for the RTOS.
More about Fixed Priority Preemptive Scheduling
– Cooperative scheduling is quite different from the preemptive scheduling.
– In former, a process can be executed fully without having any preemption from other processes.
– For switching a task, the scheduler has to be explicitly called.
– Some real – time operating systems such as TinyOS or Salvo make use of the cooperative scheduling.
– Because of the preemptive scheduling the processes with higher priority are able to preempt the execution of a lower priority process.
– The lower priority job is then moved to the suspended state and is resumed after the completion of the higher priority process.
– However, preemptive scheduling is not good to use if the number of low priority jobs is more than the number of higher priority jobs.
– This type of scheduling comes in to effect when for the same process slot there are two competing jobs.
– For a higher priority job to be able to preempt an executing lower priority job, it has to be present in the preemptive queue.
– On the other hand the lower priority jobs must be present in the pre-emptable queue.