Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [deadlocks]

The tag has no usage guidance.

0
votes
1answer
36 views

my solution to philosopher dining problem, is it deadlock and starvation free? [closed]

I couldn't understand the solution that was taught to us un the class so i came up with this code. I wanted some help to make sure it's correct or not. It looks fine to me. I assumed the no of ...
1
vote
1answer
53 views

Can 2-philosophers problem be analogous to dining philosophers problem?

Two philosophers A and B, two forks numbered "1", "2"; A needs both "1" and "2" for eating, so does B. Is this theoretical a dining philosopher problem? I'm questioning about the forks philosopher A ...
1
vote
0answers
48 views

Deadlock vs “Progress” requirement of the solution to the critical section problem

I came across following problem: Consider following code: ...
1
vote
1answer
243 views

Can a safe state in Banker's Algorithm cause deadlock eventually?

I know that unsafe state does not always mean deadlock. That is a situation that banker's algorithm does not detect deadlock accurately. I am just wondering if there is any example of a safe state ...
1
vote
1answer
81 views

What fraction of all combinations is guaranteed to be deadlock free?

I found this question in the exercise of Tanenbaum (operating systems): Two processes, $A$ and $B$,each need three records $1, 2, \text{ and } 3$ in a database. If $A$ asks for them in the order $...
3
votes
1answer
240 views

How do modern Operating Systems detect process starvation?

So first off do the modern operating systems like windows and linux have a method for detecting starvation? if not, why? and if they do, then how are they going to detect starvation of a process? (...
-1
votes
1answer
70 views

I have a question about resource alocation to avoid dead lock

In the code below, three processes are competing for six resources labeled A to F.How can I modify the get request in each procedure in this graph to avoid dead lock You cannot move requests ...
0
votes
0answers
38 views

Banker's algorithm

I have a question regarding the banker's algorithm step 2. When it says the Need[i] <= work. Need is an n * m matrix and work is a vector of length m. I want to know what Need[i] <= Work means. ...
1
vote
1answer
36 views

deadlock caused by a cyle of locks ? unprobable event causing it or just a false intuition

Thanks a lot for your help. I want to understand what really causes what I suppose to be a deadlock: I have standards objects, let's call it 'Words' that contains 3 letters and a key; (it doesn t ...
3
votes
1answer
247 views

Does starvation freedom imply progress?

The above answer taken from the book https://www.amazon.com/Operating-Systems-Sibsankar-Haldar/dp/8131730220 says starvation freedom may not imply progress as processes can be deadlocked. I think ...
0
votes
0answers
27 views

Deadlock necessary conditions [duplicate]

I read that the 4 conditions for deadlock prevention are necessary conditions and not sufficient. The four necessary conditions are :- Mutual exclusion. Hold and wait. No preemption. Circular wait. ...
0
votes
1answer
675 views

Deadlock and safe state

I read that system being in safe state doesn't guarantee that deadlock is not possible. Can someone give me an example where system is in safe state and deadlock is possible?
1
vote
0answers
47 views

Is a single starved process considered deadlocked?

In regard to the critical section problem, an algorithm that switches between allowing one of two processes, P1 or P2, to complete their critical section would cause starvation for P1 if P2 stayed in ...
3
votes
1answer
550 views

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'...
6
votes
1answer
473 views

Bounded waiting and starvation free in critical section problem

i have 4 question regarding relation between starvation and bounded waiting. 1.Does starvation-freedom imply deadlock-freedom? My Answer-: From here, definition of starvation free is Freedom ...
3
votes
1answer
619 views

When will deadlock occur in this producer-consumer code

I was reading about Producer Consumer problem from Operating Systems by William Stallings where following code was given: ...
0
votes
2answers
801 views

difference between deadlock avoidance and detection

I know the difference between deadlock prevention and avoidance. But i want to know the difference between deadlock avoidance and detection. ?
3
votes
6answers
2k views

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 ...
0
votes
1answer
321 views

Is Bounded Waiting satisfied for this 2 process Solution?

This is my new post linked with my previous post. Is bounded waiting satisfied in the 2 Process Solution? The answer in that post was very useful and cleared many concepts, but I just want to apply ...
1
vote
1answer
421 views

Is bounded waiting satisfied in the 2 Process Solution?

Suppose, There are $2$ processes $P1$ and $P2$. It is given that Mutual Exclusion and Progress are satisfied by these $2$ processes. Suppose, Programming protocol is designed such that CPU only ...
0
votes
1answer
61 views

Deadlock not possible?

System is in safe state if there exists a safe sequence of all processes. Sequence $[P_1, P_2 …P_n]$ is safe, if for each $P_i$ the resources that can still request can be satisfied by $P_i$ ...
3
votes
1answer
576 views

Why deadlock in cigarette smokers problem

"The Little Book of Semaphores" (2nd Ed. by Allen B. Downey, section 4.5.1) as well as Wiki (link) mentioned that a trivial solution (as shown below) to the 'Cigarette smokers problem' will cause a ...
4
votes
1answer
82 views

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 ...
-3
votes
1answer
333 views

A Dead-lock in an Operating System is

A Dead-lock in an Operating System is Desirable process Undesirable process Definite waiting process All of the above My attempt: As "If a process is unable to change its state indefinitely because ...
0
votes
1answer
192 views

Is bounded waiting satisfied in this 2 process solution?

Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes: ...
3
votes
1answer
2k views

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 ...
2
votes
2answers
5k views

Bankers Algorithm-Is the system in safe state?

Could somebody please provide a step-through approach to solving the following problem using the Banker's Algorithm? A system contains 10 units of resource class Ru. The resource requirements of ...
4
votes
0answers
429 views

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 ...
3
votes
0answers
243 views
4
votes
2answers
435 views

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 ...
2
votes
1answer
2k views

Confusion in Banker's Algorithm: How resources are allocated?

I have seen examples about Banker's Algorithm from this Wikipedia link, this book and many other places. In all these examples some processes are allocated ...
3
votes
1answer
80 views

Deadlock avoidance: How does the system know in advance about the number of resources required by a process?

While studying about Deadlock Avoidance I came across a paragraph which states as given below: When the system needs to issue any resource to any process, then ...
3
votes
1answer
1k views

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 ...
3
votes
2answers
3k views

Falsifying the “Circular Wait” Condition - Deadlock Prevention

In the Circular Wait condition for Deadlock Prevention section of this, it is described as follows: One way to ensure that this condition never holds is to ...
4
votes
0answers
303 views

Lamport's Bakery algorithm with other > relation

i'm reading an old exam and one question was: Which property of the Bakery algorithm is violated with the following change? ...
1
vote
1answer
156 views

Does the following modified Two-Phase Locking protocol ensure serializability and freedom from deadlock?

Consider the following variant of the two phase locking protocol. Suppose a transaction $T$ accesses (for read or write operations), a certain set of objects ${O_1,...,O_k}$. The modified algorithm ...
5
votes
3answers
877 views

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 ...
0
votes
0answers
159 views

2 phase locking with added increment mode

Suppose that a DBMS recognizes increment as an atomic operation, in addition to the read and ...
6
votes
2answers
8k views

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 ...
4
votes
1answer
120 views

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 ...
1
vote
2answers
2k views

Help interpreting this deadlock question

I have this assignment question but I am a bit unsure how to go about answering it. The question is as follows and accompanied by the image below: Three processes are competing for six resources ...
3
votes
1answer
2k views

Provide some help regarding the “Dining Philosophers Problem”?

I have an assignment based on operating systems and the question is divided into two sub-questions. The first is: Prove any seating arrangement of lefties and righties, with at least one of each ...
10
votes
5answers
11k views

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 ...
5
votes
2answers
127 views

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 ...
1
vote
0answers
111 views

two phase locking and a contest question?

In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model? I) There is no advantage over the strict model. II) In contrast to the strict model, it ...
1
vote
1answer
313 views

Deadlock Solutions: Lock Ordering

This is from a textbook on operating systems. This is not homework, just part of the chapter on deadlocks. ...
2
votes
1answer
274 views

Disabeling interrupts to solve critical section issue on multiprocessor system

Assume I have a multicore system and a critical section. I understand how disableling interrupts on a single core systems solves the critical section problem. So assume I could disable interrupts on ...
0
votes
1answer
68 views

What happens if the holder of a lock tries to acquire a lock? [closed]

In a system, suppose there is a process and a resource with only one instance. Let us assume that the process holds the instance and requests the same instance of that resource. Will there be a ...
1
vote
0answers
198 views

Solve a basic mutex lock problem while preventing deadlock

I am solving a problem with a bridge, where you have a one way bridge with people coming from each side. To solve this problem while preventing deadlock (two people going opposite directions on the ...