php.net |  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
Votes:9
Avg. Score:4.8 ± 0.6
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 49 = ?
Subscribe to this entry?

 
 [2009-06-30 20:56 UTC] sc1n at yahoo dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-30 21:01 UTC] sc1n at yahoo dot com
This bug is somewhat related: http://bugs.php.net/bug.php?id=39168&edit=2 .  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] jani@php.net
-Package: Feature/Change Request +Package: Semaphore related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Oct 22 11:01:29 2019 UTC