Show / Hide Table of Contents

Class Epoch

Implements epoch-based reclamation.

Inheritance
object
Epoch
Inherited Members
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public sealed class Epoch

Constructors

View Source

Epoch()

Initializes a new EBR implementation.

Declaration
public Epoch()

Methods

View Source

Enter()

Enters the current epoch without the execution of the deferred actions.

Declaration
public Epoch.Scope Enter()
Returns
Type Description
Epoch.Scope

A scope that represents the current epoch.

Remarks

This method is reentrant. It is recommended to call this method by the reader.

Exceptions
Type Condition
AggregateException

One or more deferred actions thrown an exception.

View Source

UnsafeClear()

Invokes all deferred actions across all epochs.

Declaration
public void UnsafeClear()
Remarks

This method is not thread-safe and cannot be called concurrently with other threads entered a protected region with Enter(). The caller must ensure that all threads finished their work prior to this method.

Exceptions
Type Condition
InvalidOperationException

Not all threads relying on the current instance finished their work.

AggregateException

One or more deferred actions throw an exception.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)

See Also

Practical lock-freedom
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾