Subj : mutex and process termination To : comp.programming.threads From : Christoph Bartoschek Date : Fri Apr 01 2005 10:46 am Hi, what happens when a process holding mutexes dies? I'm speaking in terms of pthread mutexes. Are the mutex ressources cleaned up by the kernel as for example open file descriptors? Are some kernel structures left used which are limited and can eventually get exhausted? I wonder whether a faulty programm, which locks a mutex and dies immediately after that, can force me to reboot the machine, if it is executed several million times. Right now I'm thinking that the kernel cleans everything up, but in Unix Network Programming Volume 2, Page 174 one can read: When a mutex is shared between processes, there is always a chance that the process can terminate (perhaps involuntarily) while holding the mutex lock. There is no way to have the system automatically release held locks upon process termination. We will see that read-write locks and Posix semaphores share this property. Is there a difference with mutexes which are shared between processes and normal mutexes? Greets, Christoph Bartoschek .