Professional Documents
Culture Documents
The Issues
For any of the Short Term scheduling policies, one needs to compute
the following :
i) Specify the Gantt Chart ( A chart depicting the allocation sequence
of each of the processes {User Process block as well as Kernel
Processes} to the CPU as well as the corresponding CPU
occupancy time.)
ii) The average Turn around time for ALL the concerned USER
Processs CPU bound Chunks.
iii) The average Waiting time for ALL the concerned USER Processs
CPU bound Chunks.
.
4/28/2012
CPU_Sche_Policy
PSD
2.
1 Unit
Context Switch
1 Unit
Enqueuer
2 Units
4/28/2012
CPU_Sche_Policy
PSD
Arrival of any new Process will cause the running user process to be preempted and invoking of the Enqueuer while invoking of Enqueuer will also
cause the context switch before & after the Enqueuer.
3.
For any of the specified Ready Queue Status one needs to compare
the performances of the adopted scheduling policies following non
preemptive scheduling policies :
(a)First come First Served (FCFS).
(b) Shortest Job First (SJF) based on the Estimated Service Time.
(c) Dead Line based (starting with job having shortest service time in case of
Same Deadline Limits).
(d) Pre-Fixed Priority Based with Fixed Number of Priority levels , where
each of the Processes assigned a Pre-Fixed Priority from the set of
available number of Priorities.
Context Switch
1 Unit
3 Units
Context Switch
1 Unit
4/28/2012
CPU_Sche_Policy
PSD
4/28/2012
CPU_Sche_Policy
PSD
Case Study - 1
Consider a typical Ready queue status of a computer
system having Uni-processor with support for multi
programming as given below.
The Policy :
a) Form the READY Queue of Processes
based on their Arrival Time.
b) Select Process from the READY Queue
Front for Dispatching.
c) Repeat the previous step till READY
Queue is Empty.
------------------------------------------------------------------------4/28/2012
CPU_Scheduling
CPU_Sche_Policy
PSD
PSD
4/28/2012
CPU_Sche_Policy
PSD
CPU_Sche_Policy
PSD
GANTT Chart
EnQEnQEnQEnQDiSEnQDiS
P1 P3 P0 P2 P1 P4 P1
5
11
4/28/2012
PSD
CPU_Scheduling
PSD
PSD
DiS
DiS
P1 P3 P3 P0
429 434
CPU_Sche_Policy
DiS
P2
P0
484 489
689
P2
694
DiS
P4
944
P4
949
PSD
1249
4/28/2012
CPU_Sche_Policy
PSD
10
The Policy :
a) Form the READY Queue of Processes
based on their Estimated Service Time.
b) Select Process from the READY Queue
Front for Dispatching.
c) Repeat the previous step till READY
Queue is Empty.
CPU_Sche_Policy
29
4/28/2012
24
P1
5
400
429- 5 = 424 29-5 = 24
P3
8
50
484-8 = 476 434-8 = 426
P0
10
200
689-10= 679 489-10= 479
P2
13
250
944-13=931 694-13= 681
P4
20
300
1249-20=1229 949-20= 929
-----------------------------------------------------------------------------------------
CPU_Sche_Policy
17 21
4/28/2012
14
4/28/2012
CPU_Sche_Policy
PSD
12
GANTT Chart
EnQEnQEnQEnQDiSEnQDiS
P1 P3 P0 P2 P3 P4 P3
5
11
14
17
21
24
DiS
DiS
P3 P0 P0 P2
29
79
84
DiS
P4
P2
284 289
539
DiS
P1
P4
544
844
P1
849
P3
P0
P2
P4
P1
1249
8
10
13
20
5
50
200
250
300
400
79-8 = 71
284-10= 274
539-13=526
844-20=824
1249- 5 = 1244
29-8 = 21
84-10= 74
289-13= 276
544-20= 524
849-5 = 844
-----------------------------------------------------------------------------------------
4/28/2012
CPU_Sche_Policy
PSD
13
4/28/2012
CPU_Sche_Policy
347.8 units
PSD
15
4/28/2012
CPU_Scheduling
PSD
PSD
16
GANTT Chart
CPU_Sche_Policy
4/28/2012
14
The Policy :
a) Form the READY Queue of Processes
based on their pre fixed Deadline.
b) Select Process from the READY Queue
Front for Dispatching.
c) Repeat the previous step till READY
Queue is Empty.
4/28/2012
PSD
CPU_Sche_Policy
PSD
EnQEnQEnQEnQDiSEnQDiS
P1 P3 P0 P2 P3 P4 P3
5
17
11
4/28/2012
14
17 21
24
29
DiS
DiS
P3 P0 P0 P4
79
84
284
P4
289
CPU_Sche_Policy
DiS
P1
589
PSD
594
P1
DiS
P2
994 999
P2
1249
18
8
10
20
5
13
50
200
300
400
250
79-8 = 71
29-8 = 21
284-10= 274 84-10= 74
589-20= 579 289-20= 269
994- 5 = 989 594-5 = 589
1249-13=1236 999-13=986
-----------------------------------------------------------------------------------------
4/28/2012
CPU_Sche_Policy
PSD
19
CPU_Sche_Policy
PSD
21
CPU_Scheduling
PSD
PSD
20
As soon as any new process is brought in the memory by the Medium Term Scheduler,
the following events take place in sequence:
a) The currently running process is brought back into Ready
State from the Running State.
b) The Enqueuer is brought into execution (running state) after
a context switch which brings the newly arrived process in
the Ready Queue.
c) Next the Dispatcher is invoked in order to select the process AFRESH
having the current highest priority in the Ready Queue to be
dispatched next.
Thus the previously Running Process may re-run if that is still having the Highest
Priority OR alternately a new process may get dispatched.
4/28/2012
CPU_Sche_Policy
PSD
22
-------------------------------------------------------------------------
Priority_Sche_Policy
PSD
4/28/2012
CPU_Sche_Policy
4/28/2012
4/28/2012
-------------------------------------------------------------------------
23
4/28/2012
CPU_Sche_Policy
PSD
24
10
1 Unit
3 Units
EnQ
P1
(Pr#3)
1 Unit
13
DiS
P1
60
DiS
P0
DiS
P1
63
68
80
DiS
P0
83
88
DiS
P0
1 Unit
2 Units
4/28/2012
CPU_Sche_Policy
88
1 Unit
PSD
25
130
4/28/2012
133
138
CPU_Sche_Policy
200
203
208
PSD
26
DiS
P1
DiS
P2
304
309
864 869
559
DiS
P3
1215
DiS
P4
564
864
1220
1720
------------------------------------------------------------------------4/28/2012
CPU_Sche_Policy
PSD
27
4/28/2012
Priority_Sche_Policy
PSD
28
4/28/2012
CPU_Scheduling
CPU_Sche_Policy
PSD
PSD
29