Given all the options to have processes or threads interact with each other (locks, mutex, semaphores, message queues, shared memory, etc), I'm a bit lost about what's best to do what I want.
I want several processes to wait for a certain event to happen. That is, I want them to block either until
- a certain timeout is reached, or
- a certain event is triggered by another process.
At any time, there can be an arbitrary number of such waiting processes and when the wake-up event happens, all of them must wake up, not just one.
And the one restriction that probably makes this much harder is: It has to be PHP and it must also work from mod_php running in apache.