Posted by Chung Leong on 05/04/06 22:43
abrtlt@yahoo.com wrote:
> I read in Programming PHP (O'Reilly) that flock() "cannot prevent two
> PHP scripts running in the same web server process from accessing a
> file at the same time".
> In my case a single PHP script appends text strings to an existing text
> file. Several clients may trigger the same script on the same web page
> and thus more than one PHP instance might try to open and append text
> to the same file at the same time. I would assume that using flock()
> _does_ in fact prevent simultaneous access in this case. Am I correct?
> Thanks!
>
> Andrew
What is meant I think is that flock() does not work on multithreaded
environments like Windows, where all multiple PHP instances run inside
the same process.
[Back to original message]
|