ReaderWriterSpinLock Class

Represents a fast, lightweight reader/writer lock that uses spinning to perform locking. No recursive acquires or upgradable locks are allowed (i.e., all entered locks must be exited before entering another lock).

Definition

Namespace: Gemstone.Threading
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.110 -- Release Build+13c244059615c58a533059438f38d7e59ef0c2ea
public class ReaderWriterSpinLock
Inheritance
Object    ReaderWriterSpinLock

Remarks

This reader/writer lock uses SpinWait to spin the CPU instead of engaging event based locking. As a result it should only be used in cases where lock times are expected to be very small, reads are very frequent and writes are rare. If hold times for write locks can be lengthy, it will be better to use ReaderWriterLockSlim instead to avoid unnecessary CPU utilization due to spinning incurred by waiting reads.

Constructors

ReaderWriterSpinLockInitializes a new instance of the ReaderWriterSpinLock class

Methods

EnterReadLock Enters the lock in read mode.
EnterWriteLock Enters the lock in write mode.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExitReadLock Exits read mode.
ExitWriteLock Exits write mode.
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also