Wednesday 3 June 2015

Q61,paper3, j13. An operating system using banker’s algorithm for deadlock avoidance has ten dedicated devices (of same type) and has three processes P1, P2 and P3 with maximum resource requirements of 4, 5 and 8 respectively. There are two states of allocation of devices as follows :



State 1
Processes 
P1 
P2
 P3
Devices allocated
2
3
4

State 2
Processes

P1
P2
P3
Devices
allocated
0
2
4
Which of the following is correct ?

(A) State 1 is unsafe and state 2 is safe.
(B) State 1 is safe and state 2 is unsafe.
(C) Both, state 1 and state 2 are safe.
(D) Both, state 1 and state 2 are unsafe.

Answer B.

Explanation.
State 1
Processes 
P1 
P2
 P3
Devices allocated
2
3
4
Max Demand
4
5
8
Demand-Alloction
2
2
4
State 1 is safe  total demand-allocation is less than 10.(available)
State 2
Processes
Devices
allocated
P1
P2
P3
0
2
4
Max Demand
4
5
8
Demand-Alloction
4
3
4
State 2  is unsafe because demand-allocation is > 10(availability).

No comments:

Post a Comment

Note: only a member of this blog may post a comment.