Beginner Topic 13 of 51 Operating Systems
Priority Scheduling
Choosing tasks according to assigned importance.
How it works
Priority scheduling assigns each process a priority and always runs the highest-priority ready one, either preemptively or non-preemptively. Priorities can be static, set by the administrator or process type, or dynamic, changing with waiting time or behavior. Equal priorities are usually broken by round robin or FCFS.
Step-by-step walkthrough
- Each task has a priority number.
- The highest priority task runs first.
- Medium comes next.
- Low priority waits and may starve.
- Aging gradually raises the priority of waiting tasks.
Where it is used
Real-time systems, operating-system kernels distinguishing interrupts, daemons and user programs, and the nice values in Unix use priority scheduling.
Common pitfall
Low-priority processes can starve forever; aging gradually raises priority with waiting time to prevent this. Priority inversion occurs when a low-priority task holding a lock blocks a high-priority one, which priority inheritance fixes, as in the famous Mars Pathfinder bug. Careless priorities can make the system unresponsive.
Where it fits in the course
Priority Scheduling is topic 13 of 51 in Operating Systems, rated Beginner. It follows Shortest Job First. The next topic is Shell and Command Line.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Priority Scheduling?
Where do people use Priority Scheduling?
What is the most common mistake with Priority Scheduling?
What should I learn before this topic?
How can I practice it?
Is Priority Scheduling hard to learn?
How long does it take to learn Priority Scheduling?
Which topics are related to Priority Scheduling?
What should I study after Priority Scheduling?
Related topics
- Shortest Job First (Operating Systems)
- Shell and Command Line (Operating Systems)
- Round Robin Scheduling (Operating Systems)
- Fork and Exec (Operating Systems)
- Priority Queue (Data Structures)
- Priority Inversion (Concurrency & Parallelism)
- Real-Time Constraints and Scheduling (Mobile, Embedded & IoT)