Skip to content

Fasteners

Python standard library provides an Exclusive Lock for threads and Exclusive Lock for processes spawned by multiprocessing module. fasteners provides additional three synchronization primitives:

  • Exclusive Lock for independent processes
  • Readers Writer Lock for independent processes
  • Readers Writer Lock for threads

Installation

pip install fasteners

Usage

See User Guide and Reference for usage tips and examples.

Similar libraries

portarlocker: readers writer lock and semaphore for independent processes, exclusive lock based on redis.

py-filelock: exclusive lock for independent processes.

pyReaderWriterLock: inter-thread readers writer locks, optionally downgradable, with various priorities (reader, writer, fair).