The OpenD Programming Language

ReadWriteMutex.Policy

Defines the policy used by this mutex. Currently, two policies are defined.

The first will queue writers until no readers hold the mutex, then pass the writers through one at a time. If a reader acquires the mutex while there are still writers queued, the reader will take precedence.

The second will queue readers if there are any writers queued. Writers are passed through one at a time, and once there are no writers present, all queued readers will be alerted.

Future policies may offer a more even balance between reader and writer precedence.

Values

ValueMeaning
PREFER_READERS

Readers get preference. This may starve writers.

PREFER_WRITERS

Writers get preference. This may starve readers.

Meta