Questions tagged [deadlock]

Situation where two (or more) operations need overlapping sets of resources, and neither can complete because they cannot obtain all locks necessary to complete an operation and release their locks.

Deadlock is situation where multiple operations are waiting for same resource(s) while simultananeously holding other resources that other threads holding the desired resources are waiting for.

For example, given resources A,B,C and processes 1,2.

  1. 1 locks A and B
  2. 2 locks C
  3. 2 needs A to finish
  4. 1 needs C to finish.

Neither 1 or 2 can release resources before finishing. Therefore, deadlock occurred.

The classical solution to all deadlock problems is to always acquire the resources in the same order in all threads or processes.

Reference

Deadlock in Wikipedia

3451 questions
1
vote
1 answer

Springboot and H2 shutdown deadlock

Currently I'm able to create a deadlock when using the combination of h2 and spring boot. There's a lot of issues out there, that looks kind of similar, but apparently they have been solved, and I'm not entirely sure if it's Spring or h2 that does…
Rohde Fischer
  • 1,248
  • 2
  • 10
  • 32
1
vote
2 answers

How to explain the reason for this deadlock?

There are tow transaction,transaction 1 holds an S lock on a row,transaction 2 wants to update the row,then transaction 2 waits,then transaction 1 also performs an updates on the row,at this time a deadlock occurs,I think Know what the reason is ?…
TangWan
  • 11
  • 3
1
vote
0 answers

Tensorflow / Keras Deadlock in fit_generator for data-generators, which have an interal tf-model

The Task Running keras.model.fit_generator with use_multiprocessing=True and multiple workers on a data generator that itself contains a tensorflow or keras model. This issue is very related:…
Markus Weber
  • 1,059
  • 1
  • 11
  • 24
1
vote
1 answer

Hanging parent process after running a timed-out subprocess and piping results

I wrote some code to run a script (via a subprocess) and kill the child process after a certain timeout. I'm running a script called "runtime_hang_script.sh" that just contains "./runtime_hang," which runs an infinite loop. I'm also redirecting…
1
vote
0 answers

What is the underlying cause of deadlocks warned about by MVC1000 (Use of IHtmlHelper.Partial may result in application deadlocks...)

When trying to compile a call to HtmlHelper.Partial in an ASP.NET Core MVC application, I get the following warning: warning MVC1000: Use of IHtmlHelper.Partial may result in application deadlocks. Consider using Tag Helper or…
ChaseMedallion
  • 20,860
  • 17
  • 88
  • 152
1
vote
2 answers

How can I generate threads deadlock on MacOs?

I'm learning to handle threads deadlock, but by executing the C code on my terminal, execution does not generate deadlocks even if it should. Can anyone tell me why and possibly how to force the…
1
vote
2 answers

Postresql SQL State: 25P02 Deadlock?

My task is to create a deadlock with two SQL Transactions. I work in PgAdmin. The task says: "Create two SQL transactions that can be executed interactively (annotate in comments in which order the transactions should be interleaved) to create a…
1
vote
1 answer

I'd like to create a deadlock in my program but it's not working(C, fork, paralell-programming)

I'd like to create a deadlock after down(&s); printf("c s %d\n",s); It suppose to stuck after down(&s); printf("c s %d\n",s); and I cant figure out why not. So I'd like to ask some help. void down(int *s){ while(*s<0 ||…
ripper19
  • 13
  • 2
1
vote
0 answers

How to fix 'Deadlock found when trying to get lock; try restarting transaction' Django/MySQL application

I have a django application using MySQL and I'm currently having an issue debugging a deadlock (i am relatively new to SQL) that is happening sporadically (it wont happen for an hour or two and then all the sudden I will get 10 deadlocks in a row). …
Kilgore
  • 65
  • 9
1
vote
1 answer

How to synchronize operations?

I have this implementation for two-phase locking. The problem is it works perfect in most of the scenarios but not all of them. I figure out the problem come because of my usage of Synchronized which is used in wrong way some how! I need the order…
Khalifeh
  • 11
  • 3
1
vote
1 answer

Multi-threaded application shows only one thread when running !ntsdexts.locks in WinDbg. How to know other thread causing deadlock?

I am trying to debug a multi-threaded application deadlock using windbg. It just shows one thread as output when I run !ntsdexts.locks command in windbg. How can I find other thread which is blocking it? I am not getting any hint like on which…
Chirag Acharya
  • 126
  • 1
  • 12
1
vote
1 answer

Why access Task.Result in the synchronous mode doesn't cause a deadlock?

As we all know to access the Result property of Task in the UI thread and synchronous mode will deadlock. As theoretical follow code will deadlock but not. Can you please explain why? // My "library" method. public static async Task
Plato Ngo
  • 13
  • 3
1
vote
1 answer

PLSQL Oracle 12c deadlock, why is an SSX Table lock aquired for independent deletes?

I have the following two queries resulting in a deadlock. But do not know why Oracle tries to make an SSX Table lock in this scenario. All test samples tried to replicate the problem, do only row locking. …
Lukas H
  • 123
  • 1
  • 6
1
vote
2 answers

tempdb is not growing under Read Committed Snapshot Isolation

In order to remedy deadlocks (introduced by indexed view), I attempted to utilize RCSI in sql server. I engaged this mode by: ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION ON and…
Gene
  • 11
  • 1
1
vote
0 answers

Can a call to printStackTrace hangs my program

I have 2 threads running. One for network event, the other one for the program logic. Since I need some synchronization, I use the Java ReetrantLock class. Network thread workflow: - Receive a message - Wait for the lock (myLock.lock()) - Pass the…
Django
  • 110
  • 7
1 2 3
99
100