9,107 views
14 votes
14 votes

With single resource, deadlock occurs

  1. if there are more than two processes competing for that resources
  2. if there are only two processes competing for that resources
  3. if there is a single process competing for that resources
  4. none of these

5 Answers

Best answer
20 votes
20 votes
is it processor or process any way assuming  it is process then surerly C can not be the ans

option B 2 process are competing for the resource one can be given and let executed so no deadlock

option A more than 2 processes competing again any one can be allocated and hence execute since there is no circular wait

ans should be D none of these
selected by
7 votes
7 votes

Answer D

Necessary conditions for deadlock are:

  • Mutual exclusion
  • Hold and wait
  • No preemption
  • Circular Wait

For deadlock to occur, one process must hold a resource which is needed by another process to complete.

For example: Consider two processes - A & B

  • A must hold some resource R1 which is needed by B.
  • B should be in need of R1, for B to complete.
  • A must need more resources for it to complete. And these more resources  should not be available i.e either down or caught by someone. This is important because, otherwise, A will complete and will release resources, which can then be used by B. 

So, A must hold and wait and B must circular wait for deadlock to occur.

Coming to question:

Since there is only one resource, no chances of circular wait, so no chance of deadlock

4 votes
4 votes
Option D will be right option please use your intuition and find out exact answer for this question.

Single process can not be compete for itself.

If exactly two process exist then one will complete its execution then second will puts its hand for execution and all will get chance after execution and there is no circular loop exist in this problem.
0 votes
0 votes

What if mutual exclusion occurs?

According to definition of  deadlock, either of the follwing condition will be there.

A deadlock situation can arise if and only if the following four conditions hold simultaneously in a system-

Mutual Exclusion: At least one resource is held in a non-sharable mode that is only one process at a time can use the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released.

Hold and Wait:There must exist a process that is holding at least one resource and is waiting to acquire additional resources that are currently being held by other processes.

No Preemption: Resouces cannot be preempted; that is, a resource can only be released voluntarily by the process holding it, after the process has completed its task.

Circular Wait: There must exist a set {p0, p1,.....pn} of waiting processes such that p0 is waiting for a resource which is held by p1, p1 is waiting for a resource which is held by p2,..., pn-1 is waiting for a resource which is held by pn and pn is waiting for a resource which is held by p0.

What if any one among several processes acquires that resource and dont release it.? Definitely it will create mutual exclusion and deadlock.

So, answer  should be 'A'.

Answer:

Related questions

9 votes
9 votes
7 answers
1
asu asked Jul 4, 2016
10,892 views
A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, thenDeadlock can never occurDeadlock may occurDeadlock has to occurNone of these...
8 votes
8 votes
3 answers
2
Arjun asked Jul 6, 2016
10,779 views
At a particular time of computation the value of a counting semaphore is 7. Then 20 $P$ operations and $x$ $V$ operations were completed on this semaphore. If the new val...
17 votes
17 votes
2 answers
3
go_editor asked Jul 6, 2016
9,057 views
For the real time operating system, which of the following is the most suitable scheduling scheme?Round robinFirst come first servePre-emptiveRandom scheduling