In OS, a deadlock is where two or more processes are waiting indefinitely for an event that can be caused by one of the waiting processes. Deadlock is a common problem in distributed systems, parallel computing & multiprocessing systems.
Questions tagged [deadlocks]
80 questions
13
votes
5 answers
Why unsafe state not always cause deadlock?
I was reading Operating Systems by Galvin and came across the below line,
Not all unsafe states are deadlock, however. An unsafe state may lead
to deadlock
Can someone please explain how deadlock != unsafe state ?
I also caught the same line…
vikkyhacks
- 399
- 2
- 3
- 9
9
votes
1 answer
Inconsistent state of a lock
I'm reading The Art of Multiprocessor programming and trying to understand their concept of inconsistent locks. Specifically, on page 37, the definition 2.8.1 of an inconsistent lock is not clear to me, as well as Lemma 2.8.1.
Definition 2.8.1. A…
alexwriteshere
- 241
- 1
- 5
7
votes
3 answers
Bounded waiting and starvation free in critical section problem
I have 4 questions regarding relation between starvation and bounded waiting.
1.Does starvation-freedom imply deadlock-freedom?
My Answer:
From here,
definition of starvation free is
Freedom from Starvation -:Every thread that attempts to acquire…
laura
- 337
- 1
- 3
- 12
7
votes
6 answers
Does Deadlock imply Starvation
If there is a deadlock between the processes does that mean that there is starvation also?
My Thinking:
deadlock is no process using that resources , but starvation is like not giving chance to only that process so there is progress in starvation…
Pavan Kumar Munnam
- 398
- 3
- 12
6
votes
1 answer
How to satisfy bounded waiting in case of deadlock?
I have a doubt regarding bounded waiting.
Deadlock implies no Progress because the processes take indefinite time to decide who will enter the critical section .
But, Does deadlock implies no bounded waiting ?
I think No because bounded waiting is…
Garrick
- 492
- 1
- 7
- 24
6
votes
1 answer
Is this solution to the dining philosopher's problem entirely valid?
In a question on Stack Overflow, the answer by Patrick Trentin lists the following solution to the dining philosopher's problem:
A possible approach for avoiding deadlock without incurring
starvation is to introduce the concept of altruistic…
Akshat Mahajan
- 201
- 1
- 8
6
votes
2 answers
Minimum number of processes for the deadlock?
A system has 6 identical resources and $N$ processes competing for
them. Each process can request at most two requests. Which one of the
following values of $N$ could lead to a deadlock?
1
2
3
4
My attempt:
Deadlock free condition is:
$R \geq…
hululu
- 475
- 3
- 12
- 32
5
votes
3 answers
When do deadlocks occur?
I was reading about deadlocks in Operating Systems. Where I came across two examples below.
Circles with label $P_x$ are processes. Squares with label $R_x$ are resources. Each dot in the square represents single instance of resource type $R_x$.…
Mahesha999
- 1,773
- 7
- 30
- 45
5
votes
2 answers
For a given certain situation how to prove that the system will never get into the state of Deadlock
The situation is as follows
'm' process shares 'n' resources of same type. The maximum need of
each process does not exceed 'n' and the sum all their maximum needs
is always less than m+n. In this set up will deadlock ever occur
This is a…
Prateek
- 476
- 1
- 3
- 13
4
votes
1 answer
A real life system that faces and solves the dining philosophers problem
I'm looking for an application of the dining philosophers problem. Is there some real life system that faces the concurrency problem of "the dining philosophers problem" and implements a solution? I've been searching for over an hour.
It would be…
842Mono
- 223
- 2
- 8
4
votes
1 answer
How does lack of deadlock relate to computability in process calculi?
I'm interested in knowing things about the computability of concurrent programs. If you had a Turing complete language that also let you branch off new programs but had no means of communication between them there would be programs that you couldn't…
Jake
- 3,810
- 21
- 35
4
votes
2 answers
How probable is a deadlock in the dining philosophers problem
I created this simulation of the dining philosophers problem, but did not manage to initialize it with four philosophers without running into a deadlock:
*Philosophers are represented by black beads. They think when running in small circles and…
Hans-Peter Stricker
- 171
- 6
4
votes
1 answer
What is the difference between "deadlock prevention" and "deadlock avoidance"
I have studied about both of these on many places like this, this and this, but still it is not that much clear that what the actual difference is between these two.
The Wikipedia links (first and second links mentioned above) say about deadlock…
swdeveloper
- 641
- 2
- 11
- 17
4
votes
1 answer
Does a reentrant list for signal queue in a single-thread environment exist?
I need to handle Unix signals in a single-threaded application with the following goals:
Signals doesn't mask on receive (thus, the signal handler must be reentrant).
I am not allowed to lose signal data (thus, if a new signal comes before the…
peterh
- 468
- 4
- 19
4
votes
1 answer
How do locks work?
Suppose I have an application with two threads, which both use the same resource.
Normally, a synchronized block keeps these threads from messing with the resource in a way the user doesn't expect.
I understand why you do this, but I need an…
RunOrVeith
- 239
- 1
- 7