Skip to content

PgCustomScanSharedMemory<TShared>

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Gives one process’s parallel custom scan the shared memory the leader and workers coordinate through.

public sealed class PgCustomScanSharedMemory<TShared> where TShared : unmanaged

Type parameters:

TShared

The shared memory’s layout.

PostgreSQL owns the memory and frees it when the parallel scan ends; the handle stops working at that point.

Inheritance: object

Exclusive<T>(PgDsmLwLockSelector<TShared, T>)

Section titled “Exclusive<T>(PgDsmLwLockSelector<TShared, T>)”

Acquires exclusive read/write access to a lock in the shared memory, waiting for all other holders to release it.

public PgLwLockExclusiveGuard<T> Exclusive<T>(PgDsmLwLockSelector<TShared, T> select) where T : unmanaged

Type parameters:

T

The value the lock protects.

Parameters:

select — PgDsmLwLockSelector<TShared, T>

Selects the lock’s field, such as static (ref Shared shared) => ref shared.Counter.

Returns: PgLwLockExclusiveGuard<T>

A callback-scoped exclusive guard.

Exceptions:

Acquires shared read access to a lock in the shared memory, waiting for an exclusive writer to release it.

public PgLwLockShareGuard<T> Share<T>(PgDsmLwLockSelector<TShared, T> select) where T : unmanaged

Type parameters:

T

The value the lock protects.

Parameters:

select — PgDsmLwLockSelector<TShared, T>

Selects the lock’s field, such as static (ref Shared shared) => ref shared.Counter.

Returns: PgLwLockShareGuard<T>

A callback-scoped shared guard.

Exceptions:

Gets the shared memory. Update fields that several processes write with PgAtomicValue<T> operations.

public ref TShared Value { get; }

Value: TShared

Exceptions: