Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 1997 | Question 74

  • Last Updated : 30 Oct, 2017

An operating system handles requests to resources as follows.
A process (which asks for some resources, uses them for some time and then exits the system) is assigned a unique timestamp are when it starts. The timestamps are monotonically increasing with time. Let us denote the timestamp of a process P by TS(P).

When a process P requests for a resource the OS does the following:

(i) If no other process is currently holding the resource, the OS awards the resource to P.
(ii) If some process Q with TS(Q)<TS(P) is holding the resource, the OS makes P wait for 
     the resources.
(iii) If some process Q with TS(Q)>TS(P) is holding the resource, the OS restarts Q 
      and awards the resources to P.
(Restarting means taking back the resources held by a process, killing it and starting it 
again with the same timestamp)

When a process releases a resource, the process with the smallest timestamp (if any) amongst those waiting for the resource is awarded the resource.
a). Can a deadlock ever arise? If yes, show how. If not, prove it.
b). Can a process P ever starve? If yes, show how. If not, prove it.



Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :