In documentation for the core module (manual/mod/core.xml), there's a very prominent warning about the safety of pthread mutexes: "On most systems, if a child process terminates abnormally while holding a mutex that uses this implementation, the server will deadlock and stop responding to requests. When this occurs, the server will require a manual restart to recover. Solaris is a notable exception as it provides a mechanism which usually allows the mutex to be recovered after a child process terminates abnormally while holding a mutex. If your system implements the pthread_mutexattr_setrobust_np() function, you may be able to use the pthread option safely." Linux has supported robust pthread mutexes for quite some time: Documentation/robust-futexes.txt went into the kernel in 2006, and man pages for pthread_mutexattr_setrobust_np were added in ~2008. There may well be systems that still don't support it, so the warning should probably still stay, but could you please add Linux to the list of systems where it's safe?
Created attachment 33381 [details] Added Linux as platform that supports strong pthread mutex
Hi Daniel, I checked your statement and added a patch for the documentation, let me know if you want me to add more info. I don't have commit permissions so we'll need to wait for somebody to pick this bug up :) Luca
Hi Luca, Thanks for the patch! I've done some more reading, and it seems that robust mutexes were added to POSIX, in Issue 7 (released 2008). (See http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_getrobust.html, or for a more accessible explanation, http://stackoverflow.com/questions/9804915/robust-pthread-mutexes-portability-across-platforms ) This is definitely bikeshedding, but maybe it would be worth rewording the patch to say that it's available on Solaris, Linux and any other system that supports POSIX robust mutexes? Thanks again. Daniel
Created attachment 33422 [details] Added Linux as platform that supports strong pthread mutex + POSIX Hi Daniel, do you think that the following sentence embodies your thoughts? "If your system is POSIX compliant or if it implements the pthread_mutexattr_setrobust_np() function, you may be able to use the pthread option safely." Added new patch just in case :) Luca
Thank you. Applied to trunk in r1724265. Applied to 2.4 in r1724267.