Package org.multiverse.stms.gamma
Class GlobalConflictCounter
- java.lang.Object
-
- org.multiverse.stms.gamma.GlobalConflictCounter
-
public final class GlobalConflictCounter extends java.lang.Object
The GlobalConflictCounter is used as a mechanism for guaranteeing read consistency. Depending on the configuration of the transaction, if a transaction does a read, it also makes the read semi visible (only the number of readers are interesting and not the actual transaction). If a updating transaction sees that there are readers, it increased the GlobalConflictCounter and forces all reading transactions to do a conflict scan once they read transactional objects they have not read before. This mechanism is based on the SkySTM. The advantage of this approach compared to the TL2 approach is that the GlobalConflictCounter is only increased on conflict and not on every update. Small transactions don't make use of this mechanism and do a full conflict scan every time. The advantage is that the pressure on the GlobalConflictCounter is reduced and that expensive arrives/departs (requiring in most cases 1 or 2 cas operations) are reduced as well.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLong
counter
-
Constructor Summary
Constructors Constructor Description GlobalConflictCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
count()
Gets the current conflict count.void
signalConflict()
Signals that a conflict occurred.
-