Pages

Thursday, 14 June 2012

CS604 Assignment no 4 Spring 2012 Idea Solution


Question 1:

Suppose we have a system with three processes P3, P4 and P5 and ten resources of the same type (e.g. magnetic
tapes). The three processes have declared maximum simultaneous resources requirements and current allocation
as given in the following table.

Process Max Need Current Usage
P3 8 3
P4 5 1
P5 8 2
Available resources = 4

What is the sequence of allocations to each process (up to their maximum needs) which will allow all processes
to finish in a safe state?

Question 2:

Write a code or pseudo code by using monitor
i)  To deposit money in a bank account
ii)  To withdraw money from a bank account.