Day 01Part 12- Operating system for computer – Concept of Priority information in Operating system

Day 01Part 12- Operating system for computer – Concept of Priority information in Operating system



play-rounded-fill play-rounded-outline play-sharp-fill play-sharp-outline
pause-sharp-outline pause-sharp-fill pause-rounded-outline pause-rounded-fill
00:00

 Concept of Priority in Operating Systems

In an Operating System (OS), priority plays a crucial role in process scheduling, ensuring that important tasks get CPU time before less critical ones. Priority scheduling is widely used in real-time systems, multitasking environments, and resource allocation.

 What is Priority in an Operating System?

Priority refers to a numerical value assigned to a process that determines its importance in execution. A higher priority process gets executed before a lower priority process.

 Types of Priority Scheduling

 Static Priority Scheduling

 Priority is assigned before execution and remains unchanged.
 Example: Kernel processes, system tasks (always have high priority).
 Used in real-time systems where priority is predefined.

 Dynamic Priority Scheduling

 Priority changes during execution based on factors like aging, CPU burst time, or I/O requirements.
 Prevents starvation (low-priority processes getting delayed indefinitely).
 Example: Aging Technique (low-priority processes gradually gain higher priority).

 Types of Priority Scheduling Algorithms

Algorithm Description Advantages Disadvantages
Preemptive Priority Scheduling Higher priority process preempts (interrupts) a lower one. Ensures important tasks execute quickly. Can cause starvation of low-priority processes.
Non-Preemptive Priority Scheduling Higher priority process waits until the current process finishes. Simple and avoids frequent context switching. Long waiting times for lower-priority processes.

 Example of Priority Scheduling

Given processes and their priorities:

Process Priority Burst Time (ms)
P1 3 10
P2 1 5
P3 4 2
P4 2 8

Execution Order (Higher number = Higher priority):
🟢 P3 → P1 → P4 → P2 (Executed in descending order of priority).

 Advantages & Disadvantages of Priority Scheduling

Efficient execution of critical tasks (useful in real-time systems).
Allows flexibility (different priority levels for different tasks).
Starvation problem (low-priority tasks may get delayed indefinitely).
Requires additional scheduling mechanisms like aging to prevent starvation.

 Final Thoughts

Priority scheduling is widely used in real-time OS, process management, and multitasking systems. It ensures that high-priority tasks are executed efficiently, but proper techniques (like aging) must be used to prevent lower-priority processes from waiting indefinitely.

Would you like detailed examples, Gantt charts, or comparison with other scheduling algorithms?

Day 01Part 12- Operating system for computer – Concept of Priority information in Operating system

OPERATING SYSTEM Lecture Notes On

Operating System Concepts, 8th Edition

Operating System Concepts



Leave a Reply

Your email address will not be published. Required fields are marked *

error: