Interface Epoch.INativeResourceManager
Represents a manager of the unmanaged resources which release is deferred by Epoch.
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
[CLSCompliant(false)]
public interface Epoch.INativeResourceManager
Remarks
Epoch links the deferred resources together without allocations. The link is stored in the resource itself, at the location provided by GetNextHandle(nuint).
Methods
View SourceGetNextHandle(nuint)
Gets a reference to the location inside the resource reserved for the link to the next deferred resource.
Declaration
ref nuint GetNextHandle(nuint handle)
Parameters
| Type | Name | Description |
|---|---|---|
| nuint | handle | The handle of the resource. |
Returns
| Type | Description |
|---|---|
| nuint | A reference to the location of the link. |
Remarks
Epoch owns the location from the moment the resource is deferred until it is released. During this period, the location must not be read or modified by any other code, including the consumers that still access the resource. The location must be the same for every call with the same handle.
Release(nuint)
Releases the resource.
Declaration
void Release(nuint handle)
Parameters
| Type | Name | Description |
|---|---|---|
| nuint | handle | The handle of the resource. |
Remarks
Epoch calls this method when the resource is no longer available to any consumer. The method can be called on any thread, and outside the epoch scope.