public interface BackoffPolicy
Txn
or an atomic operation can't make any progress, e.g.
because there a ReadWriteConflict
. If the next attempt would
be done without waiting, the contention is going to increase. It can be better to back off to give the
contending Transactions some time to complete so that the chance increases that the failing Txn
can complete at a next attempt.
Of course when there is a lot of contention, the BackoffPolicy isn't going to help and the Txn
could start to suffer from a livelock/starvation.Modifier and Type | Method and Description |
---|---|
void |
delay(int attempt)
Delays the calling Thread.
|
void |
delayUninterruptible(int attempt)
Delays the calling Thread without being interrupted.
|
void delay(int attempt) throws InterruptedException
The implementation is free to make this a no-op call.
attempt
- InterruptedException
void delayUninterruptible(int attempt)
The implementation is free to make this a no-op call.
attempt
- theCopyright © 2020. All rights reserved.