Re: Behavior of the sleep function?
| From: | Christoph Becker | Date: | Tue, 10 Mar 2015 20:46:51 +0000 |
| Subject: | Re: Behavior of the sleep function? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324616@lists.php.net to get a copy of this message | ||
Jeffry Killen wrote:
> On Mar 10, 2015, at 11:40 AM, Christoph Becker wrote:
>
>> flock() implements *advisory* file locking, i.e. it works only if *all*
>> file accesses use flock() to probe for a lock. So, basically, you have
>> to call flock($_fw, LOCK_EX) also for $_GET['tstNo'] == '2'.
>
> Thank you for the info:
>
> I am assuming that sleep uses output buffering, so it doesn't matter
> completely when it is called(?)
I probably don't understand your statement/question. Anyhow, sleep()
simply pauses execution of the script, independently of output buffering.
I just found <http://www.tuxradar.com/practicalphp/8/11/0>,
where a very
simplistic example of flock() in combination with sleep() is given.
Please don't forget to "reply to all" next time.
--
Christoph M. Becker