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

Here’s a clear explanation of the Concept of Priority in Operating Systems, ideal for Day 01 – Part 12 of your study plan.


🖥️ Operating System – Concept of Priority (Day 01 – Part 12)

📌 What is Priority in Operating Systems?

In an Operating System (OS), priority is a value assigned to a process that helps the CPU decide which process to run first when multiple processes are ready to execute.

It is a fundamental concept in process scheduling to ensure that important or urgent tasks are given preferential access to CPU time.


🧠 Why Priority Is Used

  • To manage multitasking
  • To ensure faster response for critical processes (like system tasks or real-time apps)
  • To prevent starvation or ensure fairness (when used with aging)

🧾 Types of Priority:

Type Description Example
Static Priority Fixed at the time of process creation Real-time system may assign fixed priorities
Dynamic Priority Can change during execution Based on aging or process behavior

🧮 How Priority Scheduling Works:

  1. The CPU scheduler selects the process with the highest priority.
  2. If two processes have the same priority, it may use FCFS (First Come First Serve).
  3. Can be preemptive or non-preemptive:
    • Preemptive: A higher-priority process can interrupt a lower-priority one.
    • Non-preemptive: The current process runs to completion even if a higher-priority one arrives.

🧾 Example:

Assume three processes with the following priorities (lower number = higher priority):

Process Burst Time Priority
P1 5 ms 2
P2 3 ms 1
P3 4 ms 3

👉 CPU Order (Preemptive): P2 → P1 → P3
👉 CPU Order (Non-Preemptive): Based on arrival time and priority


🚫 Drawbacks of Priority Scheduling

  • Starvation: Low-priority processes may never get CPU time.
  • Solution: Use Aging – gradually increase the priority of waiting processes.

✅ Summary Table

Term Meaning
Priority Rank of process importance
Preemptive High-priority interrupts low-priority
Non-preemptive Current process completes before switching
Starvation Low-priority process gets ignored
Aging Priority increases the longer a process waits

Let me know if you’d like:

  • Practice problems
  • GATE-style MCQs
  • Real-world OS examples (like Linux or Windows)

I’m happy to assist further!

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



Leave a Reply

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

error: