OptimisticFailureCause
The RollbackCause
for a NestingLevel
whose optimistic execution was
invalid, and that should be retried. The specific situations in which an
optimistic failure can occur are specific to the STM algorithm, but may
include:
The RollbackCause
for a NestingLevel
whose optimistic execution was
invalid, and that should be retried. The specific situations in which an
optimistic failure can occur are specific to the STM algorithm, but may
include:
- the STM detected that the value returned by a previous read in this nesting level is no longer valid;
- a cyclic dependency has occurred and this nesting level must be rolled back to avoid deadlock;
- a transaction with a higher priority wanted to write to a
Ref
written by this transaction; - the STM decided to switch execution strategies for this atomic block; or
- no apparent reason (*).
(*) - Some STMs perform validation, conflict detection and deadlock cycle breaking using algorithms that are conservative approximations. This means that any particular attempt to execute an atomic block might fail spuriously.
- Value Params
- category
an STM-specific label for the reason behind this optimistic failure. The set of possible categories is bounded.
- trigger
the specific object that led to the optimistic failure, if it is available, otherwise
None
.