(a)Define the terms job scheduler and
CPU scheduler [2marks ]
A job scheduler
determines which processes should be admitted for processing (1 mark),
while a CPU scheduler selects processes in the ready queue and allocates
them CPU (1 mark). Other valid answers should also receive credit.
[2 marks ]
(b)How does pre-emptive scheduling differ
from non pre-emptive scheduling?[2 marks]
Pre-emptive scheduling allows the CPU to be forcefully taken away
from a process that is currently using it (1 mark) ,while non pre-emptive
scheduling involves a process keeping the CPU fo as long as it equires
it (1 mark). Other valid answers should also receive credit. [2 marks
]
(c)Describe three objectives of scheduling.[3
marks ]
One mark should be awarded for each description (up to a maximum of
three marks). Examples include the following:
Ensure that each process gets a fair share of CPU time.
Ensure that the CPU is kept 100%busy.
Minimise the response time for interactive users.
Minimise the waiting time for output.
Keep throughput high. Other valid answers should also receive
credit.
[3 marks ]
(d)Consider the following table:
Process
|
Burst time
|
Priority
|
1
|
7
|
4
|
2
|
9
|
1
|
3
|
1
|
2
|
4
|
3
|
3
|
Assume that 4 represents the highest priority and 1 represents the
lowest priority,
and that the time quantum is 4.
For the above table, compute the average waiting time for the following
scheduling
algorithms:
(i)Shortest Job First.[2 marks ]
(i) (0+1
+4 +11 )/4
=16
/4 (1mark)
=4
(1 mark) [2 marks ]
(ii)First Come First Serve.[2 marks ]
(ii) (0+7
+16 +17 )/4
=40
/4 (1 mark)
=10
(1 mark) [2 marks ]
(iii)Priority.[2 marks
]
(iii) (0+7
+10 +11 )/4
=28
/4 (1 mark)
=7
(1 mark) [2 marks ]
(iv)Round Robin.[2 marks ]
(iv) (0+4
+8 +9 +8 +11 )/4
=40
/4 (1 mark)
=10
(1 mark) [2 marks ]
|