note 56602 added to function.flock
| From: | vladatNOTNEEDEDeasysoftdotee at osu1 dot php dot net | Date: | Thu, 08 Sep 2005 21:52:59 +0000 |
| Subject: | note 56602 added to function.flock | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94927@lists.php.net to get a copy of this message | ||
I was searching for the idea to get flock() to work without data loss, and unfortunately all i read
here was not helpful to me, after some hard testing i still get some data lost or corrupted.
So my suggestion is how to make a really data safe mechanism is to organize something like simple
multithreaded queue daemon, that will listen for connections and wait for data to be sent and push
it to some queue. Then process data from the queue and store it to file/sql or whatever we need.
Another words: we get data queued and then processed and stored without any flock(); Also this gives
us possibility to have centralized data sysytem (in case we need to collect data from different
remote servers).
Sure this will be not so easy as flock(), so people who count on proffessionalism and not luck, may
find this helpful.
Thnx.
----
Manual Page -- http://www.php.net/manual/en/function.flock.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56602
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56602&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56602&report=yes
Search -- http://master.php.net/manage/user-notes.php