PRIORITY ( PREEMPTIVE )
P.P.
Basic Theory :
Priority Scheduling is a method of scheduling
processes that is based on priority. In this algorithm, the
scheduler selects the tasks to work as per the priority. The
processes with higher priority should be carried out first,
whereas jobs with equal priorities are carried out on a
round-robin or FCFS basis. Priority depends upon memory
requirements, time requirements, etc.
In Preemptive Scheduling, the tasks are mostly assigned with their priorities. Sometimes it is important to run a task with a higher priority before another lower priority task, even if the lower priority task is still running. The lower priority task holds for some time and resumes when the higher priority task finishes its execution.
In Preemptive Scheduling, the tasks are mostly assigned with their priorities. Sometimes it is important to run a task with a higher priority before another lower priority task, even if the lower priority task is still running. The lower priority task holds for some time and resumes when the higher priority task finishes its execution.
- First, the processes are called according to their increasing arrival time.
- If the new process arrived at the ready queue has a higher priority than the currently running process, then the incoming new process with higher priority is executed.
- Once all the processes get available in the ready queue, the algorithm will behave as a non-preemptive priority.