Go Back

A Quick Abstract:

1. Introduction to Non-Preemptive Priority Scheduling:

Definition:

 Non-Preemptive Priority Scheduling is a CPU scheduling algorithm where each process is assigned a priority, and the process with the highest (or lowest, depending on the variant) priority is selected for execution.

2. Priority Assignment:

Priority Levels:

Each process is assigned a priority value, indicating its importance or urgency.

3. Execution and Process Selection:

High Priority Variant:

The process with the highest priority is selected for execution.

Ties can be resolved using additional criteria like arrival time or process ID.

Low Priority Variant:

The process with the lowest priority is selected for execution.

4. Waiting Time and Turnaround Time:

Waiting Time:

Waiting time is the cumulative time a process spends in the ready queue.

Turnaround Time:

Turnaround time is the overall time taken by a process from submission to completion.

5. Pros and Cons:

High Priority Variant:

Allows for fair execution of tasks with less urgency.

Might result in delayed execution for lower priority tasks.

Low Priority Variant:

Allows for fair execution of tasks with less urgency.

Might result in delayed execution for higher priority tasks.

6. Starvation:

High Priority Variant:

There is a risk of lower priority tasks starving for CPU time.

Low Priority Variant:

There is a risk of higher priority tasks starving for CPU time.

7. Example Scenario:

Consider processes A, B, and C with priority levels 3, 1, and 2, respectively.

High Priority Variant:

Process A has the highest priority (3) and is executed first.

Ties can be broken based on additional criteria if needed.

Low Priority Variant:

Process B has the lowest priority (1) and is executed first.

Again, ties can be resolved using other criteria.

In this scenario, the High Priority Variant selects Process A, which has the highest priority, while the Low Priority Variant chooses Process B, which has the lowest priority. This illustrates the divergence in scheduling decisions between the two variants.

8. Conclusion:

In conclusion, Non-Preemptive Priority Scheduling offers a flexible approach by considering the priority levels of processes. However, it requires careful consideration to prevent starvation for lower priority tasks or delayed execution for higher priority tasks.

Notes From The Slides:



Priority Scheduling

Example of Priority Scheduling

Process

Burst Time

Priority

P1

10

3

P2

1

1

P3

2

4

P4

1

5

P5

5

2