April 1999
SW204: SOFTWARE AND FILES DESIGN

QUESTION 3

Total Marks: 20 Marks

Click here to access other questions

GRADE A
Sample student's solutions are indicated in green.
Return to Question 3

 

(a) There are three techniques which may be used to achieve virtual memory management. One of these techniques is pagination.
(i) Name the two other techniques which may be used to achieve pagination. [2]
(ii) Discuss four characteristics of the techniques named in part (i). [8]
(i) The two other techniques of virtual memory management are overlay and segementation.

(ii) The four characteristics of techniques of overaly and segmentation are :

Overlay - It will use a part of memory for the monitoring the system. It has a permanent portion for the permenent processes. The primary and the secondary overlay will swapping into the memory to run (overwrite).

Segmentation - Memory is divided to the segment of variable size. Each segment is independent and can grow or shrink without affecting other segment. To access it, the system will identify the segment number and adress. IT enble sharing and ensure protection.

 

(b) Using the Banker’s Algorithm, determine whether the situations described below are in a safe or an unsafe state. In both cases, show how your answer was derived.
(i) A system with a total of 12 tape drives. [6]
 
Process Maximum drive needed Drive allocated
P0 10 5
P1 4 2
P2 9 2

 

(ii) A system with the following resources:
  • A: 10 units
  • B: 5 units
  • C: 7 units
[4]
 
Process Allocation Maximum
  A B C A B C
P0 0 1 0 7 5 3
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
(i) Safe
The system with a total of 12 tapes drives, reduce the drive already allocated, that is
12 - (5+2+2) = 12-9 = 3 remain.

First, perform the process P1, this process need two more tape drives, when it finished, the remain tape drives will be 5.
Then, perform the process P0, this process need five more tape drives, when it finished, the remain tape drives will be 10.
At last, perform the process P2, this process need seven more tape drives, when it finished, the remain tape drives are total 12.

Therefore, the system is in a safe state.

(ii) Safe
Assume that the maximum resource of A is 10, B is 5 and C is 7.
Therefore, the remain of resources of
A = 10 -(2+3+2) = 3
B = 5 - (1+1) = 3
C = 7- (2+1+2) = 2

The process are :

  A B C
P1 finished 5 3 2
P3 finished 7 4 3
P4 finished 7 4 5
P0 finished 7 5 5
P2 finished 10 5 7

The system can finished all the process, it is safe.