From: "Tom Lane" <tgl@sss.pgh.pa.us>
> To forestall this scenario, I'm thinking of introducing backoff into the
> sleep intervals --- that is, after first failure to get the spinlock,
> sleep 10 msec; after the second, sleep 20 msec, then 40, etc, with a
> maximum sleep time of maybe a second. The number of iterations would be
> reduced so that we still time out after a minute's total delay.
What about use the same algorithm used in ethernet when a collision is
detected?
When a collision occurs:
1) Stop sending. 2) Wait for some random amount of time between 0-T seconds 3) Try again. 4) If collision occurs
again,increase T using an algorithm, go to Step 2.
algorithm:
T = rand ( 2n -1 ) * 51.2 ms
where n- number of collisions
Regards
Gaetano Mendola