21,968 views
40 40 votes

An operating system implements a policy that requires a process to release all resources before making a request for another resource. Select the TRUE statement from the following:

  1. Both starvation and deadlock can occur
  2. Starvation can occur but deadlock cannot occur
  3. Starvation cannot occur but deadlock can occur
  4. Neither starvation nor deadlock can occur

5 Answers

Best answer
55 55 votes
Answer: (B)

Starvation can occur when a process requests a resource but is required to release all its currently held resources. If the process has not yet utilized those resources effectively, this situation can repeat itself whenever it tries to request additional resources. As a result, the process may experience starvation, leading to inadequate resource use.

Deadlock will not occur in this scenario, as it resembles a deadlock prevention mechanism.
• edited by
10 10 votes

B) is correct.

Releasing all resources before making a request for another resource is a technique of deadlock prevention.So, deadlock cannot occur.However, we cannot say anything about starvation, it may occur or may not.

4 4 votes
Option B is right option for it.

First it simple method by which deadlock can be prevented but sometimes process execution takes places on some resources and new request is required by it but still some resourses are available to use it.In that condition starvation can be happpen.
1 1 vote
(B) Starvation can occur but deadlock cannot ocuur

The reason of not occuring deadlock is it will eliminate the hold and wait condition through which atleast one resource would be hold by the process and wait for the next one but here all the resources will get released.

The reason of occuring starvation is due to : for example

1. A low priority process release all its resources aiming of getting new resources.

2 At the same time these resources acurired by the higher priority process.

3. Now in future these resources will not be gathered by low priority process acording to its need or whenever it needs them.

So starvation may come.
0 0 votes

credit for slide: @GOClasses @Sachin Mittal 1 

  1. The policy forces a process to release all its resources before making a new resource request.
     
  2. Therefore, a process can never hold some resources while simultaneously waiting for another resource.
     
  3. This eliminates the Hold-and-Wait condition, which is one of the four necessary conditions for deadlock.
     
  4. Since one necessary condition for deadlock is permanently broken, deadlock cannot occur. 
     
  5. However, this policy does not guarantee that every process will eventually get the resources it needs.
     
  6. For example, suppose P1 has resources R1,R2 and now needs R3. It must first release R1,R2.
     
  7. Before P1 gets a chance to reacquire them, other processes may grab those resources.
     
  8. P1 may then repeatedly release what it has, request again, lose the race, and repeat the whole circus. 🎪
     
  9. Thus, starvation is possible, even though deadlock is impossible.
     
  10. Therefore, the correct conclusion is:

Deadlock cannot occur, but starvation can occur.

  

Answer:
Position:
Show:

Related questions

58 58 votes
5 answers 5 answers
16.3k
16.3k views
Ishrat Jahan asked Oct 28, 2014
16,326 views
The following is a code with two threads, producer and consumer, that can run in parallel. Further, $S$ and $Q$ are binary semaphores quipped with the standard $P$ and $V...
86 86 votes
10 answers 10 answers
37.4k
37.4k views
Ishrat Jahan asked Oct 28, 2014
37,411 views
Assume that a main memory with only $4$ pages, each of $16$ bytes, is initially empty. The CPU generates the following sequence of virtual addresses and uses the Least Re...
49 49 votes
6 answers 6 answers
21.0k
21.0k views
Ishrat Jahan asked Oct 27, 2014
21,021 views
A paging scheme uses a Translation Look-aside Buffer (TLB). A TLB-access takes $10$ ns and the main memory access takes $50$ ns. What is the effective access time(in ns) ...
1 1 vote
0 0 answers
2.4k
2.4k views
Ishrat Jahan asked Oct 27, 2014
2,407 views
Consider the execution of the following commands in a shell on a Linux operating sys­tem.bash\$ cat alphaMathematicsbash\$ In alpha betabash\$ rm alphabash\$ cat > beta <...