Re: database abstraction layer

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

 



Robert Cummings wrote:
Rene Veerman wrote:
eh thats "randomize the timing of the retry attempt"..


On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman <rene7705@xxxxxxxxx> wrote:

and after the sleep(rand(1,3)) it might need a short loop like this;
$rnd = rand(1,99999); $a=0;
for ($i=0; $i<$rnd; $i++) { $a++ }

to further randomize the retry attempt..

While this decreases the probability of a collision you're just setting up another race. They teach about this stuff in computer science... right around first year... or at least they once upon a time did.

Cheers,
Rob.

Einstein I believe said something along the lines of

"A smart person solves a problem.
A wise person avoids it in the first place"

Might not have been Einstein, but anyway ...

--
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