Posted by Rik on 07/25/07 14:46
On Wed, 25 Jul 2007 16:25:13 +0200, Webrickco <webrickco@gmail.com> wrote:
> A race condition?
You write in a file that may be opened by another instance of the same
counter[*]. At least implement something like flock() so you make sure
your own scipt doesn't bug.
[*]
Chronological:
1. First request
2. Second request
3. 1.Opening for writing.
4. 2.Opening for writing.
5. 1.Writing to file.
6. 2.Writing to file.
What do you think will happen? It all depends on being written to & closed
before opening it again in another instance.
--
Rik Wasmus
[Back to original message]
|