NOTE:
- Forked / backed up from https://github.com/dimaqq/pthread_mutexattr_init/fork
- Also see: https://stackoverflow.com/questions/35265781/share-futex-between-unrelated-processes
Can 2 unrelated processes share a mutex and condition variable?
Yes they can!
GNU C library already provides the mechanism, it's documented, though not advertised.
Here are Python bindings and a practical test.
Sample code from pthread_mutexattr_init man page, reimplemented in Python.
- futex (Linux kernel)
- C library (GNU libc)