ID:               16986
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         Semaphore related
 Operating System: Linux 2.4.18
 PHP Version:      4.1.2
 New Comment:

It cause deadlock, but only on the script... if you test your script
and have a deadlock, you fix it and release the sem you forgot.

I think the auto release may be a good DEFAULT, but it is important to
be able to modify this behaviour.
If you want to fulfill any classical IPC problem (see Tanenbuam!)
You have to be able to acquire a sem, and not to realease it.

Here you ca nfind an explanation of the problems one can have and that
auto release make impossible to solve:

 
http://joda.cis.temple.edu/~ingargio/old/cis307f95/readings/readwriters.html


Previous Comments:
------------------------------------------------------------------------

[2002-05-03 06:47:10] [EMAIL PROTECTED]

But a process that acquires a semaphore and then exits will
case deadlocks, because no one else can acquire the semaphore??
Can you give a good example of where leaving the semaphore acquired is
actually useful?

------------------------------------------------------------------------

[2002-05-03 05:37:33] [EMAIL PROTECTED]

sem_acquire() function has this behavior:

After processing a request, any semaphores acquired by the process but
not explicitly released will be released automatically and a warning
will be generated. 

This is not a great thing, infact in this way the readers/writers
classical IPC problem, with writers precedence is impossible to
implement !!!

I think an option to disable autorelease is usefull.

(I sent a feature/change request, but I had no feadback :-( )


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16986&edit=1

Reply via email to