Shared LockΒΆ

While not the primary focus of the library, Door also offer implementations of read-preferring and write-preferring shared locks (readers-writer locks).

The read-preferring implementations in this library follow the pseudocode in Concurrent Programming: Algorithms, Principles, and Foundations by Michel Raynal.

The usual acquire/release interface as modelled by door.primitives.Acquirable is not sufficient to describe the functionalities of shared locks. Therefore, for door.primitives.SAcquirable, we expand the interface as follows:

  • acquire-read

  • release-read

  • acquire-write

  • release-write

We offer implementations for both synchronous and asynchronous programming. These classes of shared locks are available, for different use cases:

Read-preferring:

Write-preferring: