As we know, in the libpthread on Linux the mutex has different size in 32-bit mode and 64-bit mode. It is not possible to share a mutex in shared-memory between 32-bit apps and 64-bit apps running on the same Linux box. (If i was wrong about this, please correct me.)
We are trying to implement our own mutex library using futex in Linux to support 32-bit and 64-bit apps at the same time. I.e this mutex will have identical size and structure regardless the library is compiled into 32-bit or 64-bit.
Further, we wanted to support "robust mutex" as well and we think there is a problem here. AFAIK, glibc/libpthread creates 'robust_list' for each pthread and maintain the robust_list for every pthread mutex. This works together with the Kernel robust list functions to support robust mutex for the apps.
My question is: is it possible to attach my own mutex to the same 'robust_list' maintained by glibc/libpthread? If not, do I have to use a different robust list and give the new list to the Kernel? I suspect if I roll my own list, the app cannot use -pthread anymore. I.e. my own mutex code won't be able to co-exist with glibc pthread for the apps.
any comments or advices are appreciated.
thanks.