1.Answer
-
Multilevel Feedback Queue(Using Round-Robin within a queue);
-
The stratagy prevents process starvation by the means of aging. When a
process is waiting for the CPU, its priority will keep on increasing, which
will make it a high priority process and finally got into execution. Therefore,
starvation can be prevented.
-
Each time a process uses up its time quantum, system will lower its priority(i.e.,
process will join a lower priority queue). It is similiar to what is illustrated
in the Fig5.7 in the textbook.
5.3 Answer:
a.The four Gantt charts are:
FCFS
| 1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
2 |
3 |
3 |
4 |
5 |
5 |
5 |
5 |
5 |
RR
| 1 |
2 |
3 |
4 |
5 |
1 |
3 |
5 |
1 |
5 |
1 |
5 |
1 |
5 |
1 |
1 |
1 |
1 |
1 |
SJF
| 2 |
4 |
3 |
3 |
5 |
5 |
5 |
5 |
5 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
Priority
| 2 |
5 |
5 |
5 |
5 |
5 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
3 |
3 |
4 |
b.Turnaround time:
|
FCFS |
RR |
SJF |
Priority |
| P1 |
10 |
19 |
19 |
16 |
| P2 |
11 |
2 |
1 |
1 |
| P3 |
13 |
7 |
4 |
18 |
| P4 |
14 |
4 |
2 |
19 |
| P5 |
19 |
14 |
9 |
6 |
c.Waiting time(turnaround time minus burst time):
|
FCFS |
RR |
SJF |
Priority |
| P1 |
0 |
9 |
9 |
6 |
| P2 |
10 |
1 |
0 |
0 |
| P3 |
11 |
5 |
2 |
16 |
| P4 |
13 |
3 |
1 |
18 |
| P5 |
14 |
9 |
4 |
1 |
d.Shortest Job First
5.5 Answer:
a. In effect, that process will have increased its priority since by
getting time more often it is receiving preferential treatment.
b. The advantage is that more important jobs could be given more time,
in other words, higher priority in treatment. The consequence, of course,
is that shorter jobs will suffer. c. Allot a longer amount of time to processes
deserving higher priority, in other words, have two or more quantums possible
in the round-robin scheme.
7.5 Answer:
Consider the foolowing snapshot of the system.
|
Allocation |
Max |
Available |
|
ABC |
ABC |
ABC |
| P0 |
122 |
222 |
000 |
| P1 |
121 |
131 |
|
| P2 |
102 |
112 |
|
If we assume P0 can finish without getting the maximum resources, P0
can finish and return its resources to the Available list, we can then
service the request of P1.WhenP1returns its resources, Available contains
(2 4 3), thus P2 can be executed.
7.6Answer:
a. Anytime
b. Only if Max demand of each process does not exceed total number
of available re-sources, and the system remains in a safe state.
c. Same as (b)
d. Anytime
e. Anytime
f. Anytime