Title: CHAPTER 2 PROCESSOR SCHEDULING PART II
1CHAPTER 2PROCESSOR SCHEDULINGPART II
22.5 Processor Scheduling algorithms
- The goal of a scheduling algorithm is to select
the most appropriate process in the ready queue. - For simplicity, we will assume that
- we have a single I/O server and a single device
queue, - device queue always implemented with FCFS (FIFO)
method. - We also will neglect the switching time between
processes (context switching).
32.5 Processor Scheduling algorithms
- We will consider the following processes and will
apply different scheduling algorithms on it.
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
42.3.1 First-Come-First-Served (FCFS)
- In this algorithm, the process to be selected is
the process which requests the processor first. - This is the process whose PCB is at the head of
the ready queue. - Contrary to its simplicity, its performance may
often be poor compared to other algorithms.
52.3.1 First-Come-First-Served (FCFS)
- FCFS may cause processes with short processor
bursts to wait for a long time. - If one process with a long processor burst gets
the processor, all the others will wait for it to
release it and the ready queue will be crowded. - This is called the convoy effect.
62.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ A
72.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ B
82.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ B C
92.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ B C
102.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ C D
112.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ C D A
122.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ C D A
132.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ D A B
142.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ D A B
152.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ A B C
162.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ B C D
172.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ B C D
182.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ C D A
192.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ C D A
202.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ D A
212.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ A
222.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ D
232.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ D
242.3.1 First-Come-First-Served (FCFS)
Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec
A 0 4 4 4 4 4
B 2 8 1 8 - -
C 3 2 1 2 - -
D 7 1 1 1 1 1
RQ
252.3.1 First-Come-First-Served (FCFS)
- Processor utilization (35 / 35) 100 100
- Throughput 4 / 350.11
262.3.1 First-Come-First-Served (FCFS)
- Turn around time
- tatA 34 0 34
- tatB 27 2 25
- tatC 29 3 26
- tatD 35 7 28
- tatAVG (34 25 26 28) / 4 28.25
272.3.1 First-Come-First-Served (FCFS)
- Turn around time
- tatA 34 0 34
- tatB 27 2 25
- tatC 29 3 26
- tatD 35 7 28
- tatAVG (34 25 26 28) / 4 28.25
282.3.1 First-Come-First-Served (FCFS)
- Turn around time
- tatA 34 0 34
- tatB 27 2 25
- tatC 29 3 26
- tatD 35 7 28
- tatAVG (34 25 26 28) / 4 28.25
292.3.1 First-Come-First-Served (FCFS)
- Turn around time
- tatA 34 0 34
- tatB 27 2 25
- tatC 29 3 26
- tatD 35 7 28
- tatAVG (34 25 26 28) / 4 28.25
302.3.1 First-Come-First-Served (FCFS)
- Turn around time
- tatA 34 0 34
- tatB 27 2 25
- tatC 29 3 26
- tatD 35 7 28
- tatAVG (34 25 26 28) / 4 28.25
312.3.1 First-Come-First-Served (FCFS)
- Waiting time
- wtA (0 0) (15 8) (30 23) 14
- wtB (4 2) (19 13) 8
- wtC (12 3) (27 15) 21
- wtD (14 7) (29 16) (34 31) 23
-
- wtAVG (14 12 21 23) / 4 16.5
322.3.1 First-Come-First-Served (FCFS)
- Waiting time
- wtA (0 0) (15 8) (30 23) 14
- wtB (4 2) (19 13) 8
- wtC (12 3) (27 15) 21
- wtD (14 7) (29 16) (34 31) 23
-
- wtAVG (14 12 21 23) / 4 16.5
332.3.1 First-Come-First-Served (FCFS)
- Waiting time
- wtA (0 0) (15 8) (30 23) 14
- wtB (4 2) (19 13) 8
- wtC (12 3) (27 15) 21
- wtD (14 7) (29 16) (34 31) 23
-
- wtAVG (14 12 21 23) / 4 16.5
342.3.1 First-Come-First-Served (FCFS)
- Waiting time
- wtA (0 0) (15 8) (30 23) 14
- wtB (4 2) (19 13) 8
- wtC (12 3) (27 15) 21
- wtD (14 7) (29 16) (34 31) 23
-
- wtAVG (14 12 21 23) / 4 16.5
352.3.1 First-Come-First-Served (FCFS)
- Waiting time
- wtA (0 0) (15 8) (30 23) 14
- wtB (4 2) (19 13) 8
- wtC (12 3) (27 15) 21
- wtD (14 7) (29 16) (34 31) 23
-
- wtAVG (14 12 21 23) / 4 16.5
362.3.1 First-Come-First-Served (FCFS)
- Response time
- rtA 0 0 0
- rtB 4 2 2
- rtC 12 3 9
- rtD 14 7 7
-
- rtAVG (0 2 9 7) / 4 4.5
372.3.1 First-Come-First-Served (FCFS)
- Response time
- rtA 0 0 0
- rtB 4 2 2
- rtC 12 3 9
- rtD 14 7 7
-
- rtAVG (0 2 9 7) / 4 4.5
382.3.1 First-Come-First-Served (FCFS)
- Response time
- rtA 0 0 0
- rtB 4 2 2
- rtC 12 3 9
- rtD 14 7 7
-
- rtAVG (0 2 9 7) / 4 4.5
392.3.1 First-Come-First-Served (FCFS)
- Response time
- rtA 0 0 0
- rtB 4 2 2
- rtC 12 3 9
- rtD 14 7 7
-
- rtAVG (0 2 9 7) / 4 4.5
402.3.1 First-Come-First-Served (FCFS)
- Response time
- rtA 0 0 0
- rtB 4 2 2
- rtC 12 3 9
- rtD 14 7 7
-
- rtAVG (0 2 9 7) / 4 4.5