public abstract class BaseGammaTxnRef extends AbstractGammaObject
Modifier and Type | Field and Description |
---|---|
long |
long_value |
java.lang.Object |
ref_value |
int |
type |
___unsafe, identityHashCode, listeners, listenersOffset, MASK_OREC_EXCLUSIVELOCK, MASK_OREC_READBIASED, MASK_OREC_READLOCKS, MASK_OREC_READONLY_COUNT, MASK_OREC_SURPLUS, MASK_OREC_UPDATELOCK, orec, stm, valueOffset, version
FAILURE, MASK_CONFLICT, MASK_SUCCESS, MASK_UNREGISTERED, REGISTRATION_DONE, REGISTRATION_NONE, REGISTRATION_NOT_NEEDED, TRANLOCAL_COMMUTING, TRANLOCAL_CONSTRUCTING, TRANLOCAL_READ, TRANLOCAL_WRITE, TRANSACTIONTYPE_FAT_FIXED_LENGTH, TRANSACTIONTYPE_FAT_MONO, TRANSACTIONTYPE_FAT_VARIABLE_LENGTH, TRANSACTIONTYPE_LEAN_FIXED_LENGTH, TRANSACTIONTYPE_LEAN_MONO, TX_ABORTED, TX_ACTIVE, TX_COMMITTED, TX_PREPARED, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_REF, VERSION_UNCOMMITTED
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED
Modifier | Constructor and Description |
---|---|
protected |
BaseGammaTxnRef(GammaStm stm,
int type) |
Modifier and Type | Method and Description |
---|---|
void |
acquire(GammaTxn tx,
LockMode lockMode) |
void |
acquire(LockMode desiredLockMode)
Acquires a Lock with the provided LockMode.
|
void |
acquire(Txn tx,
LockMode desiredLockMode)
Acquires a Lock with the provided LockMode using the provided transaction.
|
protected int |
arriveAndExclusiveLockOrBackoff() |
boolean |
atomicCompareAndSetLong(long expectedValue,
long newValue) |
long |
atomicGetLong() |
java.lang.Object |
atomicObjectGet() |
long |
atomicSetLong(long newValue,
boolean returnOld) |
java.lang.Object |
atomicSetObject(java.lang.Object newValue,
boolean returnOld) |
Listeners |
commit(Tranlocal tranlocal,
GammaObjectPool pool) |
void |
ensure() |
void |
ensure(GammaTxn tx) |
void |
ensure(Txn self) |
private void |
evaluate(Tranlocal tranlocal,
GammaTxn tx,
Function function) |
boolean |
flattenCommute(GammaTxn tx,
Tranlocal tranlocal,
int lockMode) |
protected long |
getLong(GammaTxn tx,
LockMode lockMode) |
protected java.lang.Object |
getObject(GammaTxn tx,
LockMode lockMode) |
boolean |
hasReadConflict(Tranlocal tranlocal) |
private void |
initTranlocalForCommute(GammaTxnConfig config,
Tranlocal tranlocal) |
private void |
initTranlocalForConstruction(Tranlocal tranlocal) |
private static void |
initTranlocalForRead(GammaTxnConfig config,
Tranlocal tranlocal) |
Listeners |
leanCommit(Tranlocal tranlocal) |
boolean |
load(GammaTxn tx,
Tranlocal tranlocal,
int lockMode,
int spinCount,
boolean arriveNeeded) |
void |
openForCommute(FatFixedLengthGammaTxn tx,
Function function) |
void |
openForCommute(FatMonoGammaTxn tx,
Function function) |
void |
openForCommute(FatVariableLengthGammaTxn tx,
Function function) |
void |
openForCommute(GammaTxn tx,
Function function) |
Tranlocal |
openForConstruction(FatFixedLengthGammaTxn tx) |
Tranlocal |
openForConstruction(FatMonoGammaTxn tx) |
Tranlocal |
openForConstruction(FatVariableLengthGammaTxn tx) |
Tranlocal |
openForConstruction(GammaTxn tx) |
Tranlocal |
openForRead(FatFixedLengthGammaTxn tx,
int desiredLockMode) |
Tranlocal |
openForRead(FatMonoGammaTxn tx,
int lockMode) |
Tranlocal |
openForRead(FatVariableLengthGammaTxn tx,
int desiredLockMode) |
Tranlocal |
openForRead(GammaTxn tx,
int lockMode) |
Tranlocal |
openForRead(LeanFixedLengthGammaTxn tx,
int lockMode) |
Tranlocal |
openForRead(LeanMonoGammaTxn tx,
int lockMode) |
Tranlocal |
openForWrite(FatFixedLengthGammaTxn tx,
int lockMode) |
Tranlocal |
openForWrite(FatMonoGammaTxn tx,
int desiredLockMode) |
Tranlocal |
openForWrite(FatVariableLengthGammaTxn tx,
int lockMode) |
Tranlocal |
openForWrite(GammaTxn tx,
int lockMode) |
Tranlocal |
openForWrite(LeanFixedLengthGammaTxn tx,
int lockMode) |
Tranlocal |
openForWrite(LeanMonoGammaTxn tx,
int lockMode) |
boolean |
prepare(GammaTxn tx,
Tranlocal tranlocal) |
int |
registerChangeListener(RetryLatch latch,
Tranlocal tranlocal,
GammaObjectPool pool,
long listenerEra) |
void |
releaseAfterFailure(Tranlocal tranlocal,
GammaObjectPool pool) |
void |
releaseAfterReading(Tranlocal tranlocal,
GammaObjectPool pool) |
void |
releaseAfterUpdate(Tranlocal tranlocal,
GammaObjectPool pool) |
protected long |
setLong(GammaTxn tx,
LockMode lockMode,
long newValue,
boolean returnOld) |
protected java.lang.Object |
setObject(GammaTxn tx,
LockMode lockMode,
java.lang.Object newValue,
boolean returnOld) |
boolean |
tryLockAndCheckConflict(GammaTxn tx,
Tranlocal tranlocal,
int spinCount,
int desiredLockMode)
Tries to acquire a lock on a previous read/written tranlocal and checks for conflict.
|
___removeListenersAfterWrite, ___toOrecString, arrive, arriveAndExclusiveLock, arriveAndLock, atomicGetLockMode, atomicGetLockModeAsInt, departAfterFailure, departAfterFailureAndUnlock, departAfterReading, departAfterReadingAndUnlock, departAfterUpdateAndUnlock, getLock, getLockMode, getLockMode, getLockMode, getReadBiasedThreshold, getReadLockCount, getReadLockCount, getReadonlyCount, getReadonlyCount, getStm, getSurplus, getSurplus, getVersion, hasAnyLock, hasExclusiveLock, hasExclusiveLock, hasWriteLock, hasWriteLock, hasWriteOrExclusiveLock, identityHashCode, isReadBiased, isReadBiased, lockAfterArrive, setExclusiveLock, setIsReadBiased, setReadLockCount, setReadonlyCount, setSurplus, setWriteLock, unlockByUnregistered, upgradeReadLock, upgradeWriteLock, waitForExclusiveLockToBecomeFree
public final int type
public volatile long long_value
public volatile java.lang.Object ref_value
protected BaseGammaTxnRef(GammaStm stm, int type)
public final Listeners commit(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterFailure(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterUpdate(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterReading(Tranlocal tranlocal, GammaObjectPool pool)
public final boolean load(GammaTxn tx, Tranlocal tranlocal, int lockMode, int spinCount, boolean arriveNeeded)
private void initTranlocalForConstruction(Tranlocal tranlocal)
public final Tranlocal openForConstruction(FatMonoGammaTxn tx)
public final Tranlocal openForConstruction(FatVariableLengthGammaTxn tx)
public final Tranlocal openForConstruction(FatFixedLengthGammaTxn tx)
public final Tranlocal openForRead(LeanMonoGammaTxn tx, int lockMode)
public final Tranlocal openForRead(LeanFixedLengthGammaTxn tx, int lockMode)
private static void initTranlocalForRead(GammaTxnConfig config, Tranlocal tranlocal)
public final Tranlocal openForRead(FatMonoGammaTxn tx, int lockMode)
public final Tranlocal openForRead(FatFixedLengthGammaTxn tx, int desiredLockMode)
public final Tranlocal openForRead(FatVariableLengthGammaTxn tx, int desiredLockMode)
public final Tranlocal openForWrite(LeanMonoGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(LeanFixedLengthGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(FatMonoGammaTxn tx, int desiredLockMode)
public final Tranlocal openForWrite(FatFixedLengthGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(FatVariableLengthGammaTxn tx, int lockMode)
private void initTranlocalForCommute(GammaTxnConfig config, Tranlocal tranlocal)
public final void openForCommute(FatMonoGammaTxn tx, Function function)
public final void openForCommute(FatFixedLengthGammaTxn tx, Function function)
public final void openForCommute(FatVariableLengthGammaTxn tx, Function function)
public final void ensure()
public final void ensure(Txn self)
public final void ensure(GammaTxn tx)
protected final long setLong(GammaTxn tx, LockMode lockMode, long newValue, boolean returnOld)
protected final java.lang.Object setObject(GammaTxn tx, LockMode lockMode, java.lang.Object newValue, boolean returnOld)
public final long atomicGetLong()
public final java.lang.Object atomicObjectGet()
public final long atomicSetLong(long newValue, boolean returnOld)
public final java.lang.Object atomicSetObject(java.lang.Object newValue, boolean returnOld)
public final boolean atomicCompareAndSetLong(long expectedValue, long newValue)
public final void acquire(LockMode desiredLockMode)
Lock
ReadWriteConflict
. It could also be that the Lock is acquired, but the
Txn sees that it isn't consistent anymore. In that case also a
ReadWriteConflict
is thrown.
This call makes use of the Txn stored in the TxnThreadLocal
.
If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.
desiredLockMode
- the desired lockMode.public final void acquire(Txn tx, LockMode desiredLockMode)
Lock
ReadWriteConflict
. It could also be that the Lock is acquired,
but the Txn sees that it isn't consistent anymore. In that case also a
ReadWriteConflict
is thrown.
If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.
tx
- the Txn used for this operation.desiredLockMode
- the desired lockMode.public final boolean tryLockAndCheckConflict(GammaTxn tx, Tranlocal tranlocal, int spinCount, int desiredLockMode)
tx
- tranlocal
- the tranlocalspinCount
- the maximum number of times to spindesiredLockMode
- public final int registerChangeListener(RetryLatch latch, Tranlocal tranlocal, GammaObjectPool pool, long listenerEra)
public final boolean hasReadConflict(Tranlocal tranlocal)
protected final int arriveAndExclusiveLockOrBackoff()