RE: counting clicks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
This has a race condition where a busy server, or even a not-so-busy
one where 2 people happen to click at the same time, at least one of
them will be "missed", at best.

There's also a distinct possiblity of the counter file getting
completely trashed, depending on the OS and its underlying atomicity
of fwrite().

And, finally, you'd need "w+" in that fopen() to avoid wiping out the
old data to start with.

For this reason, and more, you're almost-for-sure better off keeping
track in a database which solves all the nasty race condition issues.
[/snip]

Exactly, YMMV

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux