228 views
0 votes
0 votes

https://gateoverflow.in/2263/gate1997-6-7

1. They said at least 4 resource are required.

First p1 comes takes two system resource, then p2 comes takes 1 system resource, then p3 comes takes 1 system resource. Now P3 needs one more resource so it is waiting for P2 to leave that resource and later P2 also needs one resource so it waits for P3 to leave resource. There will be cycle between P2 and P3. There is a deadlock, After p1 gets completed will now operating system allocate available resource to each process? because this is the only way to avoid above deadlock. Is this implemented using semaphores?

2. Also when we say one process is waiting for some resources held by another process what exactly happens in between, how one process keeps track when the other process leaves resource, which part of the os performs this function? is it done by using semaphores?

Please log in or register to answer this question.