Wednesday, 3 June 2020

UGC NET Computer Science December 2019 | Question 78

Question 78
Suppose a system has 12 magnetic tape drives and at time t0. three processes are allotted tape drives out of their need as given below:

ProcessMaximum
Needs
Current
Needs
P0105
P142
P292

At time t0, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?
  1. 1. ( P0, P1, P2 )
  2. 2. ( P1, P0, P2 )
  3. 3. ( P2, P1, P0 )
  4. 4. ( P0, P2, P1 )
Answer : 2. (P1, P0, P2 )

Explanation
Out of Total 12 magnetic tape drives, 9 magnetic tape drives are allocated. So There are 3 remaining magnetic tape drives.

ProcessMaximum
Needs
Allocated
resources
Remaining
Needs
P01055
P1422
P2927

With available 3 magnetic tape drives, process P1 requirements of 2 magnetic tape drives can be fulfilled. So, after completion of process P1, it releases total 4 magnetic tape drives.

Now, with available tap drives are 4 + 1 = 5,
Process P0 requirements of 5 magnetic tape drives can only be fulfilled. So, after completion of process P0, it releases total 10 magnetic tape drives.

Now, available tap drives are 10,
Process P2 requirements of 9 magnetic tape drives can be fulfilled.
Process P2 will completed wihtout deadlock.

The only safe sequence that avoide deadlock is (P1, P0, P2). So, that system is in safe state for given process needs.

So, option 2 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 77UGC NET CS December 2019 - Question 79

1 comment:

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts