You are on page 1of 9

HOMEWORK CHA

PROBLEM 1:
1.1
FCFS STF (non pre-emptive) & SRTF
Duration From To Process Duration From To
P1 45 0 45 P4 3 0 3
P2 23 45 68 P3 10 3 13
P3 10 68 78 P5 17 13 30
P4 3 78 81 P2 23 30 53
P5 17 81 98 P1 45 53 98

1.2
FCFS STF (non pre-emptive) & SRTF
Duration From To Process Duration From To
P1 4 0 4 P1 4 0 4
P2 45 4 49 P3 5 4 9
P3 5 49 54 P4 33 9 42
P4 33 54 87 P2 45 42 87
P5 71 87 158 P5 71 87 158

1.3
FCFS STF (non pre-emptive) & SRTF
Process Duration From To Process Duration From To
P1 49 0 49 P3 15 0 15
P2 45 49 94 P2 45 15 60
P3 15 94 109 P1 49 60 109
P4 73 109 182 P4 73 109 182
PROBLEM 2:
2.1

FCFS STF
Process Arrival Duration From To Process Arrival Duration From
P1 0 45 0 45 P1 0 45 0
P2 3 23 45 68 P4 12 3 45
P3 8 10 68 78 P3 8 10 48
P4 12 3 78 81 P5 40 17 58
P5 40 17 81 98 P2 3 23 75

2.2

FCFS STF
Process Arrival Duration From To Process Arrival Duration From
P1 0 4 0 4 P1 0 45 0
P2 5 45 5 50 P4 12 3 45
P3 8 5 50 55 P3 8 10 48
P4 10 33 55 88 P5 40 17 58
P5 15 71 88 159 P2 3 23 75

2.3
FCFS STF
Process Arrival Duration From To Process Arrival Duration From
P1 0 49 0 49 P1 0 49 0
P2 17 45 49 94 P3 20 15 49
P3 20 15 94 109 P2 17 45 64
P4 21 73 109 182 P4 21 73 109

PROBLEM 3:
THROUGHPUT TURNAROUND

Throughput = Number of processess completed per


Turnaround = Exit time - Arrival time
unit time
HOMEWORK CHAPTER 2
PROBLEM 1:
1.1
RR
Process Remaining From To
P1 45 0 12
P2 23 12 24
P3 10 24 34
P4 3 34 37
P5 17 37 49
P1 33 49 61
P2 11 61 72
P5 5 72 77
P1 21 77 98

1.2
RR
Process Remaining From To
P1 4 0 4
P2 45 4 16
P3 5 16 21
P4 33 21 33
P5 71 33 45
P2 33 45 57
P4 21 57 69
P5 59 69 81
P2 21 81 93
P4 9 93 102
P5 47 102 114
P2 9 114 123
P5 35 123 158

1.3
RR
Process Remaining From To
P1 49 0 12
P2 45 12 24
P3 15 24 36
P4 73 36 48
P1 37 48 60
P2 33 60 72
P3 3 72 75
P4 61 75 87
P1 25 87 99
P2 21 99 111
P4 49 111 123
P1 13 123 135
P2 9 135 144
P4 37 144 156
P1 1 156 157
P4 25 157 182

PROBLEM 2:
2.1

RR SRTF
To Process Arrival Remain From To Process Arrival
45 P1 0 45 0 15 P1 0
48 P2 3 23 15 30 P2 3
58 P3 8 10 30 40 P3 8
75 P4 12 3 40 43 P4 12
98 P5 40 17 43 58 P3 8
P1 0 30 58 73 P2 3
P2 3 8 73 81 P1 0
P5 40 2 81 83 P5 40
P1 0 15 83 98 P1 0

2.2

RR SRTF
To Process Arrival Remain From To Process Arrival
45 P1 0 4 0 4 P1 0
48 P2 5 45 5 20 P2 5
58 P3 8 5 20 25 P3 8
75 P4 10 33 25 40 P4 10
98 P5 15 71 40 55 P2 5
P2 5 30 55 70 P5 15
P4 10 18 70 85
P5 15 56 85 100
P2 5 15 100 115
P4 10 3 115 118
P5 15 41 118 159

2.3
RR SRTF
To Process Arrival Remain From To Process Arrival
49 P1 0 49 0 15 P1 0
64 P1 0 34 15 30 P3 20
109 P2 17 45 30 45 P1 0
182 P3 20 15 45 60 P2 17
P4 21 73 60 75 P4 21
P1 0 19 75 90
P2 17 30 90 105
P4 21 58 105 120
P1 0 4 120 124
P2 17 15 124 139
P4 21 43 139 182

PROBLEM 3:
RESPOND TIME WAITING TIME

Respond time = Started time - Arrival Time Waiting time = Turnaround - Respond time
SRTF
Remain From To
45 0 3
23 3 8
10 8 12
3 12 15
10 15 21
23 21 39
45 39 40
17 40 57
45 57 98

SRTF
Remain From To
4 0 4
45 5 8
5 8 13
33 13 46
45 46 88
71 88 159
SRTF
Remain From To
49 0 20
15 20 35
29 35 64
45 64 109
73 109 182

You might also like