Pbe1 Sesi 1 2021 - 2022
Pbe1 Sesi 1 2021 - 2022
Jumlah
Duration : 4 HOURS
QUESTION 1
Memory management strategies can be divided into: Fetch, Placement, and Replacement.
Meanwhile, placement strategy can be further divided into: Best-fit, First-fit and Worst-fit.
Instruction: Complete the table below with the correct placement type of Best-fit, First-fit or
Worst-fit.
This strategy produces the largest leftover spaces, which may be Worst-fit
more useful than the smaller leftover spaces from a best-fit approach.
Allocate the smallest free memory space that is big enough. Best-fit
This strategy searches the entire list, unless it is sorted by size. Best-fit
Searching can start either at the beginning of the set of free memory First-fit
spaces or at the location where the previous search ended.
The strategy can stop searching as soon as it finds a free memory First-fit
space that is large enough.
Allocate the largest free memory space. Worst-fit
This strategy produces the smallest leftover memory space. Best-fit
This strategy searches the entire list, unless the list is ordered by Best-fit
size.
Table 1
QUESTION 2
Schedulers are special system software which handle process scheduling in various ways.
Their main task is to select the jobs to be submitted into the system and to decide which
process to run. Schedulers are of three types; Long-Term Scheduler Short-Term Scheduler
and Medium-Term Scheduler.
a. Give the definition and explain differences between Long-Term Scheduler, Short-
Term Scheduler and Medium-Term Scheduler.
c. Draw the Round Robin scheduling algorithms by the following process given in table
2 and calculate the average waiting time when a quantum time = 20
QUESTION 3
Deadlock is a situation where a set of processes are blocked because each process is
holding a resource and waiting for another resource acquired by some other process.
a. Describe four necessary conditions for deadlock and give the scenario example.
1) Mutual exclusion
One or more than one resource must be held by a process in a non-sharable
(exclusive) mode.
3) No Preemption
There is only voluntary release of a resource.
4) Circular Wait
Process A waits for Process B waits for Process C .... waits for Process A.
Bridge Crossing example (Scenario example)
•Traffic only in one direction.
•Each section of a bridge can be viewed as a resource.
•If a deadlock occurs, it can be resolved if one car backs up (preempt resources and
rollback).
•Several cars may have to be backed up if a deadlock occurs.
•Starvation is possible