• About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment
Cuitutorial
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment

Operating System

Home » Blog » Priority Based Scheduling Algorithm in Operating system

Priority Based Scheduling Algorithm in Operating system

  • Posted by saqib
  • Categories Operating System
  • Date December 18, 2022
  • Comments 0 comment

Priority Based Scheduling Algorithm in Operating system

A set of processes where every process has a specific priority with respect to other process.

Types of Priority scheduling is Fixed and Dynamic Priority Scheduling.

In Fixed, process is assigned a fixed priority at the start.

In Dynamic during execution the priority is calculated and assigned to process.

  • Every procedure is given a priority. The process with the highest priority is given the CPU.
  • Two processes are scheduled in FCFS order if their priorities are equivalent.
  • The priority is often represented by a number between 0 and 7 or 0 and 4095. Here, we take the position that 0 denotes a high priority.
  • Time constraints, memory requirements, the number of open files, and the ratio of the average I/O burst to the average CPU burst can all be used to determine the priority.
  • It can be either preemptive or nonpreemptive.
  • When using a preemptive priority scheduling technique, the CPU will only be preempted if a newly arrived process has a higher priority than a process that is already running.
  • Whenever a nonpreemptive priority scheduling technique is used, the newly arrived process will be prioritized and moved to the front of the ready queue.
  • The main drawback of this scheduling algorithm is indefinite blocking or starvation (this algorithm can leave the low priority processes waiting indefinitely).
  • One of the most popular scheduling methods in batch systems is priority scheduling, a non-preemptive technique.

A priority is given to each procedure. The highest priority process should be carried out first, and so on.

  • Processes of the same priority are carried out in the order they are received.
  • Based on memory needs, time needs, or any other resource needs, priority can be determined.

Given: Table of processes their Arrival time, Execution time and priority. Here we are considering 1 is the lowest priority.

Process Arrival Time Execution Time Priority Service Time
P0 0 5 1 0
P1 1 3 2 11
P2 2 8 1 14
P3 3 6 3 5

Waiting time of each process:

Process Waiting Time
P0 0 – 0 = 0
P1 11 – 1 = 10
P2 14 – 2 = 12
P3 5 – 3 = 2

Average Wait Time: (0 + 10 + 12 + 2)/4 = 24 / 4 = 6

Example:

Process CPU-Burst Time Priority
P1 11 3
P2 2 1
P3 3 4
P4 1 5
P5 5 2

  • Share:
author avatar
saqib

Previous post

Shortest Job First Algorithm in operating system
December 18, 2022

Next post

Shortest Remaining Time Algorithm in Operating system
December 18, 2022

You may also like

Aging in operating system
6 January, 2023

Aging in operating system In Operating systems, Aging is a scheduling technique used to avoid Starvation. Fixed priority scheduling is a scheduling discipline in which tasks queued for utilizing a system resource is assigned each priority. A task with a …

Starvation in operating system
6 January, 2023

Starvation in operating system It is a problem when the low-priority process gets jammed for a long duration of time because of high-priority requests being executed. A stream of high-priority requests stops the low-priority process from obtaining the processor or …

Dead Lock in operating system
3 January, 2023

Dead Lock in operating system A Deadlock is a situation where each of the computer process waits for a resource which is being assigned to some another process. In this situation, none of the process gets executed since the resource …

Leave A Reply Cancel reply

You must be logged in to post a comment.

admin@cuitutorial.com
Facebook-f Twitter Youtube Linkedin Instagram Stack-overflow Pinterest Github Quora Whatsapp
Courses
  • All Courses
  • Past Paper
  • Final year projects
  • Interview Questions
  • Contact
Important Pages
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Links
  • University Events
  • Team
Education & learning platform for All Computer science subjects
Final year projects
Past Paper
Interview questions
Programming, C/C++, Asp.net/MVC. Android, MySql, Jquery, Ajax, javascript, Php, Html5, Bootstrap4.
NTS, GAT, PPSC, FPSC

Copyright © 2021 | Cuitutorial