[FEATURE] Add Preemptive Priority Scheduling Algorithm #174

Closed
opened 2026-01-29 15:07:06 +00:00 by claunia · 5 comments
Owner

Originally created by @dilipkjain on GitHub (Oct 5, 2023).

Detailed description

Algorithm

Preemptive Priority Scheduling Algorithm

Type

Process Scheduling Algorithm

Description

The preemptive priority CPU scheduling algorithm uses a rank-based system to define a rank for each process, where lower rank processes have higher priority and higher rank processes have lower priority. The preemptive priority CPU scheduling algorithm decides the priority of a process based on its rank. The scheduler selects the first process whose arrival time is 0 because that process is only executing at time t=0. Then it checks the priority of the next available process. If the current process has a higher priority than the previous one, then it executes the current process. If the current process has a lower priority than the previous one, then it executes the previous one. If both processes have equal priorities, then it executes the one that arrived first.

Context

A process scheduling algorithm, preemptive in nature i.e., the CPU is allocated to the processes for a limited time only.
The preemptive priority CPU scheduling algorithm uses a rank-based system to define a rank for each process, where lower rank processes have higher priority and higher rank processes have lower priority. The preemptive priority CPU scheduling algorithm decides the priority of a process based on its rank. The scheduler selects the first process whose arrival time is 0 because that process is only executing at time t=0. Then it checks the priority of the next available process. If the current process has a higher priority than the previous one, then it executes the current process. If the current process has a lower priority than the previous one, then it executes the previous one. If both processes have equal priorities, then it executes the one that arrived first.

Possible implementation

Add Preemptive Priority Scheduling Algorithm in Process Scheduling Folder

Additional information

No response

Originally created by @dilipkjain on GitHub (Oct 5, 2023). ### Detailed description ### Algorithm Preemptive Priority Scheduling Algorithm ### Type Process Scheduling Algorithm ### Description The preemptive priority CPU scheduling algorithm uses a rank-based system to define a rank for each process, where lower rank processes have higher priority and higher rank processes have lower priority. The preemptive priority CPU scheduling algorithm decides the priority of a process based on its rank. The scheduler selects the first process whose arrival time is 0 because that process is only executing at time t=0. Then it checks the priority of the next available process. If the current process has a higher priority than the previous one, then it executes the current process. If the current process has a lower priority than the previous one, then it executes the previous one. If both processes have equal priorities, then it executes the one that arrived first. ### Context A process scheduling algorithm, preemptive in nature i.e., the CPU is allocated to the processes for a limited time only. The preemptive priority CPU scheduling algorithm uses a rank-based system to define a rank for each process, where lower rank processes have higher priority and higher rank processes have lower priority. The preemptive priority CPU scheduling algorithm decides the priority of a process based on its rank. The scheduler selects the first process whose arrival time is 0 because that process is only executing at time t=0. Then it checks the priority of the next available process. If the current process has a higher priority than the previous one, then it executes the current process. If the current process has a lower priority than the previous one, then it executes the previous one. If both processes have equal priorities, then it executes the one that arrived first. ### Possible implementation Add Preemptive Priority Scheduling Algorithm in Process Scheduling Folder ### Additional information _No response_
claunia added the Staleenhancement labels 2026-01-29 15:07:06 +00:00
Author
Owner

@spideyWebb commented on GitHub (Oct 8, 2023):

Hi I am good at c language. Will you please assign me this issue.

@spideyWebb commented on GitHub (Oct 8, 2023): Hi I am good at c language. Will you please assign me this issue.
Author
Owner

@Gunjan-Rajput commented on GitHub (Oct 27, 2023):

please assign me this issue.

@Gunjan-Rajput commented on GitHub (Oct 27, 2023): please assign me this issue.
Author
Owner

@SarojArchana commented on GitHub (Nov 21, 2023):

@dilipkjain I have Added Preemptive Priority Scheduling Algorithm in Process Scheduling Folder can you please review my PR

@SarojArchana commented on GitHub (Nov 21, 2023): @dilipkjain I have Added Preemptive Priority Scheduling Algorithm in Process Scheduling Folder can you please review my PR
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2023):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Dec 22, 2023): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 30, 2023):

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions[bot] commented on GitHub (Dec 30, 2023): Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#174