Partial Solutions to Homework 2
May 2008
The expression allows several open or read followed by a close. Only open or only read can be executed at a given time.
It allows an openread followed by a read; several of these can occur at the same time. These are then be followed by the execution of several of "an openwrite followed by a write".
Draw the graph. Give an example of a knot in the graph and explain why it is a knot. If you find that there's no knot in the graph, express the answer as an empty set.
Knot K = { R2, P5, R3, P3 }
Reasons:
| Max-Claim B = | ![]() |
|
![]() |
| Allocation C = | ![]() |
|
![]() |
a) Find the available matrix D and need matrix E in this state.
| Need matrix E = | ![]() |
|
![]() |
b) Suppose now process P1 makes a request with
| Allocation matrix C = | ![]() |
|
![]() |
|||
| Need matrix E = | ![]() |
|
![]() |
c) To ensure the system be safe, should the request be granted? Why? Give your reasons in detail.
It should not be granted because the remaining resources ( 2 0 1 ) cannot satisfy the
maximum need of any process. i.e.,
D = ( 2 0 1 )

E1 = ( 1 1 1 )
D = ( 2 0 1 )

E2 = ( 0 2 1 )
D = ( 2 0 1 )

E3 = ( 2 0 2 )
Yes. .....
![]() |
1 0 0 |
![]() |
, | ![]() |
0 1 0 |
![]() |
, | ![]() |
0 0 1 |
![]() |
a) Draw a diagram to show all the transitions and events.
b) Find the vector clocks of all the events.
c) Give an example for each of the following:
ii) a consistent but not strongly consistent state
iii) an inconsistent state
Solutions
c) Example of :
ii) a consistent but not strongly consistent state: {e13, e21, e31}
iii) an inconsistent state: {e14, e25, e33}