NTA UGC NET JUNE-2023 Paper-2
December 27, 2023
Question 8919 – ISRO CS 2020
December 28, 2023
NTA UGC NET JUNE-2023 Paper-2
December 27, 2023
Question 8919 – ISRO CS 2020
December 28, 2023

Operating-Systems

Question 19
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L). The following scheme is used to own a resource instance:

function OWNRESOURCE(Resource R)

      Acquire lock L  //  a global lock

      if R is available then

               Acquire R

               Release lock L

        else

                if R is owned by another process P then

                      Terminate P, after releasing all resources owned by P

                      Acquire R

                      Restart P

                      Release lock L

                 end if 

         end if

  end function

Which of the following choice(s) about the above scheme is/are correct?

A
The scheme ensures that deadlocks will not occur.
B
The scheme may lead to live-lock.
C
The scheme violates the mutual exclusive property.
D
The scheme may lead to starvation.
Question 19 Explanation: 

(1) True, 

The scheme ensures deadlock free operation, as there is no hold-and-wait condition possible. 

 

(2) True, 

The scheme may lead to priority inversion problems, and hence livelock is possible. 

 

(3) False, 

Mutual exclusion is satisfied as only one process can acquire and release locks at a time.  

 

(4) True,

The scheme may lead to starvation. For example, the priority process can get scheduled repeatedly and keeps on killing the lower priority processes. Hence, a low priority process may strave.

Correct Answer: D
Question 19 Explanation: 

(1) True, 

The scheme ensures deadlock free operation, as there is no hold-and-wait condition possible. 

 

(2) True, 

The scheme may lead to priority inversion problems, and hence livelock is possible. 

 

(3) False, 

Mutual exclusion is satisfied as only one process can acquire and release locks at a time.  

 

(4) True,

The scheme may lead to starvation. For example, the priority process can get scheduled repeatedly and keeps on killing the lower priority processes. Hence, a low priority process may strave.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x