I swore POSIX forbid sharing some state between processes? What prevents structure serialization across process restart? @RichFelker ?
"If mutex does not refer to an initialized mutex object, the behavior of pthread_mutex_lock(), ... is undefined."
-
-
That is indeed sufficient to forbid such behaviour. If you consider initialization an action that is lost at process shutdown.
-
If nothing else it's lost by unreachability. The pthread_mutex_t object representation is not "the mutex" but repr's all you have
-
Right, and I think "2.9.9 Synchronization Object Copies and Alternative Mappings" would consider it an invalid alt map.
-
Yep, that's the text I was looking for but failed to find.
-
Thanks, your comments jogged my memory enough that I found the section. It's a pretty strong case for unsupported behaviour.
-
Whether glibc wants to support it as an extension is a valid question but per POSIX this is very clearly UB.
-
Why? I doubt we want that constraint on the implementation. We already can't support process shared across two implementations.
-
I don't think glibc should support this (thereby constraining itself); I'm just saying someone could argue for it.
- 2 more replies
New conversation -
-
-
See also the rationale for pthread_mutex_init, under "Alternate Implementations Possible": http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html …
-
I certainly agree with that. For hppa the glibc NPTL condvar does such a pointer to allocated memory trick for compatibility.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.