Operating system
Presentation
Group 14th
Piyush Gupta (0832AD221045)
Topic
Pre-emptive Priority
Scheduling
Piyush Gupta
0832AD221045
01
Pre-emptive Priority
Scheduling
Priority Scheduling(Basic Concept)
● A priority is associated with each process, and the CPU is
allocated to the process with the highest priority.
● Equal-priority processes are scheduled in FCFS order.
Types of Priority Scheduling
1. Preemptive Priority Scheduling
2. Non-preemptive Priority Scheduling
Preemptive priority
Scheduling
A Preemptive Priority scheduling algorithm
will pre-empt the CPU if the priority of the
newly arrived process is higher than the
priority of the currently running process.
Non-Preemptive priority
Scheduling
A Non-preemptive Priority scheduling
algorithm will put the new process at the
head of the ready queue. Here, the
currently running process will not be pre-
empted by the new process.
The priority of the process is determined in terms of high
priority and low priority. Some fixed range of numbers generally
indicates priorities. However, there is no general agreement on whether
0 is the highest or lowest priority. Some systems use low numbers to
represent low priority; others use low numbers for high priority. This
difference can lead to confusion. Here, we will assume that higher
numbers represent high priority.
Deciding the priority of a
process
Arrival Time : The time at whch process enter the Ready Queue or State
Burst Time : Time required by a Process to get execute on CPU
Completion Time : The time at which Process complete its execution
Turn Around Time : [ Completion time – Arrival time ]
Waiting Time : [Turn Around Time – Burst Time ]
Response Time : [The time at which a process get CPU first time – Arrival Time ]
“ CPU SCHEDULING “
Example
Priority Process No Arrival Time Burst Time Completion Time TAT
10 P1 0 5
20 P2 1 4
30 P3 2 2
40 P4 4 1
Pre-emptive Priority Scheduling
Higher the number higher
the Priority
Criteria: “Priority”
Mode: “Pre-emptive”
P1 P2 P3 P3 P4 P2 P1
TAT=C.T - A.T
WT=TAT – B.T
Process Arrival Time Priority CPU I/O CPU
P1 0 2 1 5 3
P2 2 3 3 3 1
P3 3 1 2 3 1
P4 3 4 2 4 1
Example : 02

djakdjjdddddddddddddddddddddddddddddddddddddddddd

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
    Priority Scheduling(Basic Concept) ●A priority is associated with each process, and the CPU is allocated to the process with the highest priority. ● Equal-priority processes are scheduled in FCFS order. Types of Priority Scheduling 1. Preemptive Priority Scheduling 2. Non-preemptive Priority Scheduling
  • 6.
    Preemptive priority Scheduling A PreemptivePriority scheduling algorithm will pre-empt the CPU if the priority of the newly arrived process is higher than the priority of the currently running process.
  • 7.
    Non-Preemptive priority Scheduling A Non-preemptivePriority scheduling algorithm will put the new process at the head of the ready queue. Here, the currently running process will not be pre- empted by the new process.
  • 8.
    The priority ofthe process is determined in terms of high priority and low priority. Some fixed range of numbers generally indicates priorities. However, there is no general agreement on whether 0 is the highest or lowest priority. Some systems use low numbers to represent low priority; others use low numbers for high priority. This difference can lead to confusion. Here, we will assume that higher numbers represent high priority. Deciding the priority of a process
  • 9.
    Arrival Time :The time at whch process enter the Ready Queue or State Burst Time : Time required by a Process to get execute on CPU Completion Time : The time at which Process complete its execution Turn Around Time : [ Completion time – Arrival time ] Waiting Time : [Turn Around Time – Burst Time ] Response Time : [The time at which a process get CPU first time – Arrival Time ] “ CPU SCHEDULING “
  • 10.
    Example Priority Process NoArrival Time Burst Time Completion Time TAT 10 P1 0 5 20 P2 1 4 30 P3 2 2 40 P4 4 1 Pre-emptive Priority Scheduling Higher the number higher the Priority Criteria: “Priority” Mode: “Pre-emptive” P1 P2 P3 P3 P4 P2 P1 TAT=C.T - A.T WT=TAT – B.T
  • 11.
    Process Arrival TimePriority CPU I/O CPU P1 0 2 1 5 3 P2 2 3 3 3 1 P3 3 1 2 3 1 P4 3 4 2 4 1 Example : 02