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 : unmanagedType 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
Methods
Section titled “Methods”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 : unmanagedType 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:
- ObjectDisposedException: The parallel scan has ended.
- ArgumentException: The selected lock isn’t in this shared memory.
- PgException: The lock wasn’t initialized, or this process already holds it.
Share<T>(PgDsmLwLockSelector<TShared, T>)
Section titled “Share<T>(PgDsmLwLockSelector<TShared, T>)”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 : unmanagedType 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:
- ObjectDisposedException: The parallel scan has ended.
- ArgumentException: The selected lock isn’t in this shared memory.
- PgException: The lock wasn’t initialized, or this process already holds it.
Properties
Section titled “Properties”Gets the shared memory. Update fields that several processes write with PgAtomicValue<T> operations.
public ref TShared Value { get; }Value: TShared
Exceptions:
- ObjectDisposedException: The parallel scan has ended.