Describe how the Priority Scheduling algorithm works. Explain the differences of working procedure between preemptive and non-preemptive version of this algorithm.
Please upvote if you are able to understand this and if there is any query do mention it in thr comment section.
The algorithm of priority scheduling is to schedule the process according to their priority. What happens in this algorithm is from all the available processes, the process which have the higher priority to complete a task are executed first and then the process with lower priority are executed. But if there is condition that any processes have same priority then their execution is determined on the basis of First Come First Serve(FCFS) algorithm.
Following are the differences between the preemptive version of this algorithm and non-preemptive version of this algorithm:
When are processes are executed in the preemptive version of this algorithm then during their execution if any other process with higher priority will come then the execution of the processes will be interrupted in between whereas if the processes are getting executed in the non-preemptive version of this algorithm then the execution of the processes will not be interrupted in between due to the presence of the process with higher priority.
The process in the preemptive version of this algorithm can be switched from ready state to running state whereas in the non-preemptive version of this algorithm the process does not switch any process from running state to ready state.
If this was supposed to be done in any other way then please mention it in the comment section otherwise please upvote.
Get Answers For Free
Most questions answered within 1 hours.