note 125342 added to function.sem-acquire
| From: | Ben@php.net | Date: | Wed, 09 Sep 2020 05:50:41 +0000 |
| Subject: | note 125342 added to function.sem-acquire | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215087@lists.php.net to get a copy of this message | ||
I recently had to use semaphores to avoid running an update of a database concurrently.
For testing it I used two browser windows (chrome) on the same Desktop.
In this case semaphores did not work as expected.
Also flock on a file did not work as expected.
Running the script from command line did work as expected.
As soon as I used two different browsers, one on my desktop another within a virutal machine, it
works like expected.
Hope that helps anybody avoiding strange debugging sessions on this topic...
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.167.36 (proxied: 80.149.156.222)
----
Manual Page -- http://php.net/manual/en/function.sem-acquire.php
Edit -- https://master.php.net/note/edit/125342
Del: integrated -- https://master.php.net/note/delete/125342/integrated
Del: useless -- https://master.php.net/note/delete/125342/useless
Del: bad code -- https://master.php.net/note/delete/125342/bad+code
Del: spam -- https://master.php.net/note/delete/125342/spam
Del: non-english -- https://master.php.net/note/delete/125342/non-english
Del: in docs -- https://master.php.net/note/delete/125342/in+docs
Del: other reasons-- https://master.php.net/note/delete/125342
Reject -- https://master.php.net/note/reject/125342
Search -- https://master.php.net/manage/user-notes.php