public class InterprocessReaderWriterLock : IDisposable
Public Class InterprocessReaderWriterLock
Implements IDisposable
public ref class InterprocessReaderWriterLock : IDisposable
Gemstone.Threading.InterprocessReaderWriterLock = function();
Type.createClass(
'Gemstone.Threading.InterprocessReaderWriterLock',
null,
IDisposable);
The InterprocessReaderWriterLock uses a NamedSemaphore to synchronize access to an inter-process shared resource. On POSIX systems, the NamedSemaphore exhibits kernel persistence, meaning instances will remain active beyond the lifespan of the creating process. The named semaphore must be explicitly removed by invoking ReleaseInterprocessResources when the last reader-writer lock instance is no longer needed. Kernel persistence necessitates careful design consideration regarding process responsibility for invoking the ReleaseInterprocessResources method. Since the common use case for named semaphores is across multiple applications, it is advisable for the last exiting process to handle the cleanup. In cases where an application may crash before calling the ReleaseInterprocessResources method, the semaphore persists in the system, potentially leading to resource leakage. Implementations should include strategies to address and mitigate this risk.
InterprocessReaderWriterLock(String, Boolean) | Creates a new instance of the InterprocessReaderWriterLock associated with the specified name that identifies a source object needing concurrency locking. |
InterprocessReaderWriterLock(String, Int32, Boolean) | Creates a new instance of the InterprocessReaderWriterLock associated with the specified name that identifies a source object needing concurrency locking. |
MaximumConcurrentLocks | Gets the maximum concurrent reader locks allowed. |
Dispose | Releases all the resources used by the InterprocessReaderWriterLock object. |
Dispose(Boolean) | Releases the unmanaged resources used by the InterprocessReaderWriterLock object and optionally releases the managed resources. |
EnterReadLock | Tries to enter the lock in read mode. |
EnterWriteLock | Tries to enter the lock in write mode. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
ExitReadLock | Exits read mode and returns the prior read lock count. |
ExitWriteLock | Exits write mode. |
Finalize |
Releases the unmanaged resources before the InterprocessReaderWriterLock object is reclaimed by GC.
(Overrides ObjectFinalize) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
ReleaseInterprocessResources | Releases inter-process resources used by the InterprocessReaderWriterLock. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
TryEnterReadLock | Tries to enter the lock in read mode, with an optional time-out. |
TryEnterWriteLock | Tries to enter the lock in write mode, with an optional time-out. |
DefaultMaximumConcurrentLocks | Default maximum concurrent locks allowed for InterprocessReaderWriterLock. |
GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |
GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |