December 1999
SW204 : SOFTWARE AND
FILE DESIGN

QUESTION 2

Total Marks: 15 Marks

Click here to access other questions

SUGGESTED SOLUTIONS
Solutions and allocated marks are indicated in green.
Return to
Question 2

(a)

(i)Give one example of the use of a shareable resource.[1 mark ]
Reading a file. Other valid answers should also receive credit.

(ii)Give one example of the use of an unshareable resource.[1 mark ]

Using a printer. Other valid answers should also receive credit.

 

[2]
(b)

Describe,using examples,three situations which may lead to deadlock.
One mark is available for naming each situation,one mark is available for each satisfactory elaboration,and one mark is available for a suitable example.

•Mutual exclusion (1 mark).Only one process can use a particular resource;if another process requests that resource,the requesting process ust be delayed until the resource has been released (1 mark).
•Hold and wait (1 mark).One process already holds at least one resource,and is waiting to acquire more resources which are held by other resources (1 mark).
•No preemption (1 mark).Resources cannot be preempted:resources can only be released voluntarily by the process holding it,after the process has completed its task (1 mark). •Circular wait (1 mark).There is a circular chain of two or more processes, each of which is waiting for a resource held by the next member of the chain (1 mark).

 

[9]
(c)

Refer to the scenario given below,in which there are three processes,A,B and C, and three resources,R,S and T.

Processes
A
B
C
Request R
Request S
Request T
Request S
Request T
Request R


Illustrate,using a Resource Allocation Graph,how deadlock may be avoided.


One mark should be awarded for the correct representation of processes and resources; one mark should be awarded for the correct representation of the holding of a resource;one mark should be awarded for the correct representation of the request for a resource;and one mark should be awarded if the overall representation is correct.

[4]