- CommuteRef <A>
- Value
- ToString ()
- GetHashCode ()
- Equals (object? obj)
- Equals (A other)
- Swap (Func<A, A> f)
- SwapIO (Func<A, A> f)
- Commute (Func<A, A> f)
- Isolation
- Ref <A>
- Value
- ValueIO
- ToString ()
- GetHashCode ()
- Equals (object? obj)
- Equals (A? other)
- Swap (Func<A, A> f)
- SwapIO (Func<A, A> f)
- Commute (Func<A, A> f)
- STM
struct CommuteRef <A> Source #
A proxy for Ref
, returned by commute
. This allows the transaction system to know that the
result is a commutative and therefore give you a result based on the live state rather than
the transaction.
See the concurrency section of the wiki for more info.
sync
transaction isolation level. Used to enforce ACI properties
of ACID on Ref
s.
See the concurrency section of the wiki for more info.
Refs ensure safe shared use of mutable storage locations via a software transactional memory (STM) system. Refs are bound to a single storage location for their lifetime, and only allow mutation of that location to occur within a transaction.
See the concurrency section of the wiki for more info.
method int GetHashCode () Source #
Hash code of the bound value
method A Swap (Func<A, A> f) Source #
Swap the old value for the new returned by f
Must be run within a sync
transaction
param | f | Swap function |
returns | The value returned from |
method IO<A> SwapIO (Func<A, A> f) Source #
Swap the old value for the new returned by f
Must be run within a sync
transaction
param | f | Swap function |
returns | The value returned from |
method CommuteRef<A> Commute (Func<A, A> f) Source #
Must be called in a transaction. Sets the in-transaction-value of ref to:
`f(in-transaction-value-of-ref)`
and returns the in-transaction-value when complete.
At the commit point of the transaction, f
is run AGAIN with the
most recently committed value:
`f(most-recently-committed-value-of-ref)`
Thus f
should be commutative, or, failing that, you must accept
last-one-in-wins behavior.
Commute allows for more concurrency than just setting the Ref's value
Software transactional memory using Multi-Version Concurrency Control (MVCC)
See the concurrency section of the wiki for more info.
property long TransactionId Source #
Get the currently running TransactionId