# A Dead-lock in an Operating System is

A Dead-lock in an Operating System is

1. Desirable process
2. Undesirable process
3. Definite waiting process
4. All of the above

My attempt:

As "If a process is unable to change its state indefinitely because the resources requested by it are being used by another waiting process, then the system is said to be in a deadlock."

So, none option should be true. However, somewhere answer key is given option $(3)$.

Can you explain it, please?

• A deadlock is not a process so I've no idea what this question is asking. – David Richerby Sep 27 '16 at 16:11
• Where is that question coming from? You might need a better textbook. – gardenhead Sep 27 '16 at 16:34
• These options are using the term "process" in a very liberal way, too much liberal for an OS course where "process" has a precise meaning. I also especially enjoy the "all of the above" option, which implies "a deadlock is a desirable, undesirable process". Logic, begone! ;-) – chi Sep 27 '16 at 16:59
• @gardenhead: Or a better teacher. Option 5 is missing: WTF? – gnasher729 Sep 28 '16 at 10:09
• You could post the question on ell.stackexchange.com (English learners); "deadlock" is one word, "Desirable process" and "undesirable process" are quite meaningless in this context; and "definite waiting process" is absolutely meaningless. None of these is anywhere near explaining what a deadlock is. – gnasher729 Sep 28 '16 at 21:27

## 1 Answer

Your attempt "If a process is unable to change its state indefinitely because the resources requested by it are being used by another waiting process, then the system is said to be in a deadlock." is close, but not quite there.

A deadlock is a situation where one "process" (not a "process" as used in software development, but something more general) is waiting for a resource which will never become available because a second "process" is using the resource, and is waiting directly or indirectly for a resource that the first process is already using.

A situation where the second process doesn't stop using the resource just for the heck of it isn't a deadlock. A similar situation where the resource stops getting used, but everytime it stops being used some other process is quicker using it, is also not a deadlock (but an example of resource starvation, which is more general than deadlock).