|
Posted by NC on 09/26/06 17:44
Sven wrote:
>
> It turns out that whenever I was testing my little example
> above, I was opening the script through a browser. For
> some reason the flock() never seems to work for me this
> way, however when I ran it from the command-line php
> things sorted themselves out.
Well, the reason is that inder Windows, scripts executed by an HTTP
server (such as Apache or IIS) run in threads, so it's possible for
multiple instances of a script to run under the same process ID (even
though the thread ID is different). With command-line execution, no
threading takes place; each instance has its own process ID...
Cheers,
NC
Navigation:
[Reply to this message]
|