Hello...
I am using a mutex synch mechanism in an multi-threaded environmnet (apache).
When I got several of the threads working - note that Apache choses the threads to be runned from a thread pool - the system gets into a deadlock and all the threads are waiting on the same mutex, without even timing out properly (10 seconds timeout, takes several minutes to get a timeout error).
I've checked and double checked, triple checked, quad checked the program and there is nothing wrong in the logic. Any thread releases the mutex once done with it and there is no way a thread enters an infinite loop or anything like that.
The only thing I can think of is a thread being terminated or killed and the mutex reference does not get signaled, which I don't think it is possible, given the mutex implementation on Windows.
The mutexes are implemented in some sys-dependent function wrappers, inside a DLL, and are spanned across several DLLs. How can this affect the mutexes? Or can it, at all??
I am totally lost on this. Two days of head-banging proved no result whatsoever.
The deadlock occurs in various places. If I removed the deadlocking mutex, I got another deadlock, in another part of the application, on another mutex.
There are no crossed mutex references - no other mutexes are asked for while a thread is holding a particular mutex, I have been careful on circular dependencies on this. And still this happens.
Any guides are greatly appreciated.
~~Razvan
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
I am using a mutex synch mechanism in an multi-threaded environmnet (apache).
When I got several of the threads working - note that Apache choses the threads to be runned from a thread pool - the system gets into a deadlock and all the threads are waiting on the same mutex, without even timing out properly (10 seconds timeout, takes several minutes to get a timeout error).
I've checked and double checked, triple checked, quad checked the program and there is nothing wrong in the logic. Any thread releases the mutex once done with it and there is no way a thread enters an infinite loop or anything like that.
The only thing I can think of is a thread being terminated or killed and the mutex reference does not get signaled, which I don't think it is possible, given the mutex implementation on Windows.
The mutexes are implemented in some sys-dependent function wrappers, inside a DLL, and are spanned across several DLLs. How can this affect the mutexes? Or can it, at all??
I am totally lost on this. Two days of head-banging proved no result whatsoever.
The deadlock occurs in various places. If I removed the deadlocking mutex, I got another deadlock, in another part of the application, on another mutex.
There are no crossed mutex references - no other mutexes are asked for while a thread is holding a particular mutex, I have been careful on circular dependencies on this. And still this happens.
Any guides are greatly appreciated.
~~Razvan
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro