Is it possible to query a semaphore created with sem_get without actually blocking like the sem_acquire function does?
Cheers, Dan.
Unfortunately, PHP does not currently support non-blocking semaphores.
If something like this is necessary you can utilize semaphores together with shared memory to create your own non-blocking lock mechanisms.
Use a shared memory variable to mark whether or not a lock exists and then use a semaphore around operations against that variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With