Questions tagged [deadlocks]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
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
0answers
345 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
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 ...
5
votes
3answers
1k 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
223 views

2 phase locking with added increment mode

Suppose that a DBMS recognizes increment as an atomic operation, in addition to the read and ...
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 ...
2
votes
1answer
373 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 ...
1
vote
1answer
383 views

Deadlock Solutions: Lock Ordering

This is from a textbook on operating systems. This is not homework, just part of the chapter on deadlocks. ...
1
vote
0answers
113 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 ...
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
201 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 ...
7
votes
1answer
686 views

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

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

Deadlock prevention by killing a victim

In our operating systems class, the teacher told us about deadlocks prevention methods. One of them is that to select as a victim the process which requires the CPU time or one that requires a lot of ...
1
vote
1answer
1k views

Bankers algorithm - How does it work?

I'm currently studying deadlocks and I'm trying to learn myself the bankers algorithm. In this example my teacher goes to B first, then C and finally A. He adds (I think) 2 (row b, Has) with 3 (...
0
votes
1answer
348 views

How to build/recognise a deadlock-free order of resources

I have been faced with a problem where three concurrent processes X, Y ,Z execute three different code segments that access and update certain shared variables. Before entering the respective code ...

1
2