note 125163 added to function.clearstatcache
| From: | vechenjivot at gmail dot com | Date: | Fri, 03 Jul 2020 18:09:29 +0000 |
| Subject: | note 125163 added to function.clearstatcache | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214828@lists.php.net to get a copy of this message | ||
Not documented, but seems like clearstatcache() is clearing the cache only for the process it is
being called from. I have 2 PHP scripts running simultaneously, and the first one does call
clearstatcache(), but still the second one deadlocks, unless I call clearstatcache() in it too:
script1:
<?php
touch('system.lock');
...
unlink('system.lock');
clearstatcache(); // should be done by unlink?
?>
script2:
<?php
while (is_file('system.lock') {
sleep(1);
clearstatcache(); // without this, script 2 will deadlock forever!
}
?>
I also found this page, which leads to the same conclusion:
https://stackoverflow.com/questions/9251237/clearstatcache-include-path-sessions
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.167.36 (proxied: 46.10.231.1)
----
Manual Page -- http://php.net/manual/en/function.clearstatcache.php
Edit -- https://master.php.net/note/edit/125163
Del: integrated -- https://master.php.net/note/delete/125163/integrated
Del: useless -- https://master.php.net/note/delete/125163/useless
Del: bad code -- https://master.php.net/note/delete/125163/bad+code
Del: spam -- https://master.php.net/note/delete/125163/spam
Del: non-english -- https://master.php.net/note/delete/125163/non-english
Del: in docs -- https://master.php.net/note/delete/125163/in+docs
Del: other reasons-- https://master.php.net/note/delete/125163
Reject -- https://master.php.net/note/reject/125163
Search -- https://master.php.net/manage/user-notes.php