|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48748 Cannot check semaphore status
Submitted: 2009-06-30 20:56 UTC Modified: 2011-01-23 21:09 UTC
Avg. Score:4.6 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:6 (75.0%)
From: sc1n at yahoo dot com Assigned:
Status: Open Package: Semaphore related
PHP Version: 5.2.10 OS: FreeBSD & Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sc1n at yahoo dot com
New email:
PHP Version: OS:


 [2009-06-30 20:56 UTC] sc1n at yahoo dot com
The PHP sysvsem implementation lacks core functionality for semaphore usage.  The missing functionality makes tasks that can commonly be solved with semaphores in other languages not possible in PHP.

Functions that that provide the following behavior should be added:

GETVAL -- Return the value of a single semaphore. (this one is really important).

GETNCNT -- Return the number of processes waiting for the value of a semaphore to increase. 

GETZCNT -- Return the number of processes waiting for the value of a particular semaphore to reach zero. 

GETPID -- Return the PID of the process that performed the last operation on the semaphore.

The flag IPC_NOWAIT should be added to sem_acquire to set the acquire has non blocking.

Expected result:
Minimum level of semaphore support that matches implementations for virtually any other programming language.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-30 21:01 UTC] sc1n at yahoo dot com
This bug is somewhat related: .  The functionality is somewhat non standard for low level implementations.  If the standard IPC_NOWAIT is added, we can create a user land function that spins in a loop with usleep to get the desired functionality.
 [2011-01-23 21:09 UTC]
-Package: Feature/Change Request +Package: Semaphore related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 18:01:29 2024 UTC