Answer A
State 1:
Total number of devices allocated = 2+3+4 =9
No of devices available = 10-9 =1
- The no of devices still needed for P1 = 4-2 =2 >1 //Cannot allocate
- The no of devices still needed for P2 = 5-3 =2 >1 //Cannot allocate
- The no of devices still needed for P2 = 8-4 =4 >1 //Cannot allocate
State 1 is unsafe
state 2
Total number of devices allocated = 0+2+4 =6
No of devices available = 10-6 =4
- The no of devices still needed for P1 = 4-0 =4 =4 //Can allocate
- The no of devices still needed for P2 = 5-2 =3 <4 //Can allocate
- The no of devices still needed for P2 = 8-4 =4 =4 //Can allocate
State 2 is safe