I swore POSIX forbid sharing some state between processes? What prevents structure serialization across process restart? @RichFelker ?
-
-
Does POSIX forbid serializing a mutex to disk and reloading it again later? Assuming you didn't change the implementation.
-
Yes. Only the original mutex object can be used. Copying it in any manner/using it as a value does not yield a usable mutex.
-
Agreed, I feel strongly that only explicitly initialized objects can be used, but I was looking for such wording in POSIX.
-
"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.
- 6 more replies
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.