I want to use shared memory across processes and wanted to use the robust pthread mutexes for the same, because, they can help with the problem when a process dies holding the mutex. My only concern is, are they portable across different platforms – different versions of linux and then on different operating systems too? The earlier versions of pthread.h have just the _NP versions ofPTHREAD_MUTEX_ROBUST attribute. I could not find much documentation about the portability online.
Would really appreciate any repsonse on the same.
POSIX mandates
pthread_mutexattr_getrobust. And hence all POSIX compliant systems should support it. Also note thatpthread_mutexattr_getrobustwas first introduced in Issue 7. ie POSIX:2008 Do check this on the systems where you want to port.On the latest linux variants, I think you should be safe.