ID: 39987 Updated by: [EMAIL PROTECTED] Reported By: wojtekm86 at konto dot pl -Status: Open +Status: Feedback Bug Type: Semaphore related Operating System: Linux PHP Version: 5.2.0 New Comment:
Cannot reproduce. sem_release() DOES remove the semaphor if no other process uses it. Previous Comments: ------------------------------------------------------------------------ [2006-12-29 17:01:23] wojtekm86 at konto dot pl Description: ------------ It's impossible to correct remove semaphores with sem_remove function when I use them to provide execution of concurrent processes. When the last process releases the semaphore I should be able to remove it. But I don't know if another process haven't acquired the semaphore. For safety reasons I don't remove released semaphores from system. Now, If I get 128 semaphores and I execute sem_get one more time I will get warning. So, I can't remove semaphores (because I don't know if another process is using it) and I can't get next semaphore. Reproduce code: --------------- $id = sem_get(SOME_ID); sem_acquire($id); HERE IS CRITICAL REGION sem_release($id); Expected result: ---------------- Expected result (and correct, I think) is removal of unused semaphore in sem_release function if another process didn't acquire it and isn't waiting for doing this. Release and Removal of semaphore should be one chain of instructions without possibility of separation (e.g. by interruption). Actual result: -------------- System reaches the maximum number of semaphores and warning is reported. The warning is: Warning: sem_get() [function.sem-get]: failed for key 0x5202e59f: No space left on device in /home/cicik/ftp/php-art/klasy/semafor.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39987&edit=1