deadlock

Joining a boost::thread instance in the destructor

I'm seeing an issue where a call to boost's thread->join in a destructor leads to a deadlock. I don't understand why, and I'm not too keen on keeping code that just works (and I don't understand why it does) in the project. Class declaration (I've stripped the run() method of try/catch for brevity: according to the boost thread documen...

resolving Deadlock

I have a Store Procedure being called to fill one table whenever we receive incoming files. Sometimes we receive more than one file and the procedure will be called simultaneously. Inside the Procedure the statements are quite simple as given below IF NOT EXISTS (SELECT.... WHERE A=1 B=2) INSERT ... ELSE UPDATE ... WHERE ...

xml Column update and Locking in Sql Server

Hi, I have a few windwos services. They get xml column from Sql server manipulate and update it. Service A- Gets XML Service B- Gets XML Service A- Updates XML (it will be lost) Service B- Updates XML I must lock row and I use next Code: SqlCommand cmdUpdate = new SqlCommand(); cmdUpdate.CommandText = "select MyXML from M...

How can I get dead lock in this situation?

In my client application I have a method like this (in practice it's more complex, but I've left the main part): public void btnUpdate_Click(...) { ... dataAdapter.Update(...); ... dataAdapter.Fill(...); // here I got exception one time } The exception I found in logs says "Deadlock found when trying to get lock; try restartin...

Win32 CreateWindow() call hangs in child thread?

I'm working on a portability layer for OpenGL (abstracts the glX and wgl stuff for Linux and Windows)... Anyhow, it has a method for creating a Window... If you don't pass in a parent, you get a real window with a frame... If you pass in a parent, you get a borderless, frameless window... This works fine, as long as I do it all on 1 thr...

How to restart transactions on deadlock/lock-timeout in Spring?

Hi, What is the best practice on implementing a transaction restart upon deadlock or lock timeout exceptions when using Spring (specifically the Spring recommended approach: declarative transactions) ? Thanks, Asaf ...

No managed thread in dump created by orphaning IIS application pool of 64 bit ASP.NET

I need to find reason for Event ID 2262, Deadlock Detected of our ASP.NET application (64bit). It happens 1-3 times per day on our development server. I created mini dump with full memory by orphaning the Application Pool as is described here: http://support.microsoft.com/kb/828222 I opened the dump with windbg and tried to find some m...

Ensuring certain private functions can only be called from a locked state

Say I have a class A: class A { public: A(); void fetch_data() { return 1; } void write_x_data() { // lock this instance of A private_function1_which_assumes_locked(); private_function2_which_assumes_locked(); // unlock this instance of A } void write_y_data() { // lock this instance of A pr...

Conversion Deadlock problem, please help!

Hi all, really hope you can help. We've got a problem with conversion deadlocking going on within one environment (the same proc + trigger works in at least four other environments). The stored proc in question inserts a row into a table (cmsreceipt) that has a trigger which updates another table (cmsreceiptarchive). To try and preven...

How to handle this Multithread situation and don't lock?

Hello, I have this situation: a Form with a System.Timer in it (with AutoReset = False). The form has its main thread and the timer its own thread too (nothing new here). When the user press a button I need to stop the timer, wait until the timer thread has stopped its execution and do something more. On the other side, the timer upd...

Deadlock calling Membership.CreateUser on a Load Test

Hi, I am getting Sql deadlocks while calling aspnet_Users_CreateUser Api during load test (100+ concurrent users) I have wrapped the createUser, roles.AddUserToRole and another custom mapping procedure inside a Transaction Scope block. Once the deadlock is encountered no more user accounts are created. I am also using Enterprise Librar...

Objective-C/Cocoa threads and messaging conundrum

Hello, I have a problem that has been plaguing me for awhile now, I have come up with a solution which I will detail below, and although it seems to be working well I'm not super enthusiastic about it from a design point of view and I'm curious if anyone would have any recommendations about a better way to do this. Basically, I have a s...

Remove deadlock without killing session

Is there any workaround to remove deadlock without killing the session? ...

Ruby threading deadlocks

I'm writing a project at the moment that involves running two parallel threads to pull data from different sources at regular intervals. I am using the Threads functionality in ruby 1.9 to do this but am unfortunately running up against deadlock problems. Also I have a feeling that the Thread.join method is causing the threads to queue r...

How to kill deadlocked threads in Java?

I'd like to kill threads that are stuck in deadlock state. First, we can detect thread ids in deadlock state using the findDeadlockedThreads() method of the ThreadMXBean class in java.lang.management. Then, I'd like to kill the threads by thread ids, and thus I have two related questions: (1) How to get the control of a thread by threa...

Mysql deadlock explanation needed

I received the following deadlock log via "SHOW INNODB STATUS". Can someone care to explain why the transaction was aborted? It seems that Transaction 2 is holding the lock, but is also stuck requesting the same lock (except for the "waiting" part), which leads to a deadlock when Transaction 1 requires it as well. ======================...

Threads and simple Dead lock cure

When dealing with threads (specifically in C++) using mutex locks and semaphores is there a simple rule of thumb to avoid Dead Locks and have nice clean Synchronization? ...

Tools for implementing a watchdog timer in python

I'm writing some code for testing multithreaded programs (student homework--likely buggy), and want to be able to detect when they deadlock. When running properly, the programs regularly produce output to stdout, so that makes it fairly straightforward: if no output for X seconds, kill it and report deadlock. Here's the function protot...

Reproducible Deadlock Using Cascading Constraints

I am looking for code to generate a reproducible deadlock that occurs from the use of Cascading Constraints. I can find references online for the specific problem, and I have answered dozens of questions on deadlocks where cascading constraints were in use, but none of them has a reproducible version of the deadlock. I am not looking fo...

Deadlock in WinForms that can be solved by right click on the taskbar

I encountered a strange problem with our Windows C# / .NET application. Actually it is a GUI application, my job is the included network component, encapsulated in an assembly. I do not know the code of the main/GUI application, I could contact it's developer though. Now the application's UI has buttons to "Start" and "Stop" the network...