20 May
2020
20 May
'20
12:06 p.m.
Niall Douglas wrote:
Coming back to shared memory mutexes etc, me personally if I want a mutex that is shared across processes and is resilient to sudden process death, I just lock a shared file in /tmp using flock(). This is completely portable: LLFIO, thanks to recent WG21 feedback, now implements SharedMutex Concept matching file_handle. Rather usefully, the content of the same shared file can also be the shared memory between the processes. One thus has exactly what the OP is looking for.
That's an interesting idea, but unfortunately I don't think there's a way to get a (robust) condition variable that works with this lock, and that's what I really need. Regards, Phil.