How can unrelated processes cooperate using a futex?
Let's say I have unrelated processes, one being, say, an apache subprocess with my module, another being e.g. a background script.
I'd like to establish a condition variable with a mutex between the two using a futex, to benefit for user-space fast code path.
It seems to me that memory at which mutex is stored could be in a mmap
'd file, if that memory is mapped, e.g. mlock
'd the two processes could theoretically issue futex calls against same address.
Alternatively, perhaps a futex can be passed from one process to another using FUTEX_FD
.
Code submissions low-, high-level and dynamic languages are accepted (C, C++, Python, etc.). "robust futex" API must be supported too.
References:
PTHREAD_PROCESS_SHARED
? – Epitheliomammap
ed without commonfork
parent. Good hint! – Frail