Jonathan Hill: What Is Wrong With PHP's Semaphore Extension
Note: This article was originally published at PHPDeveloper on 18 April 4898.
He lists five different pain points he discovered when trying to use the extension:
- Lack of a true Semaphore
- Undefined error handling
- Undefined behavior of sem_get()
- Cannot disable semaphore auto-releasing
- A semaphore may be deleted when other processes are waiting to acquire it
The semaphore extension provides a PHP-based wrapper for the System V IPC family of functions (including semaphores, shared memory and inter-process messaging).