readerwriterlock
A python implementation of the three Reader-Writer problems.
Decision gist · record as of 2026-08-14
Yes, if you need a reader-writer lock and are comfortable with an abandoned package. The implementation is marked Production/Stable with no known vulnerabilities and has 104 GitHub stars, suggesting stability. Reader-writer locks are a well-understood pattern unlikely to require frequent updates. However, verify compatibility with your Python version and consider whether the lack of maintenance is acceptable for your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a single pure-Python dependency.
- However, the package is abandoned—last release was 2021-09-06 with no recent commits.
- Use only if you need a stable, unchanging implementation and can maintain it yourself if issues arise.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions, provided you include the license notice.
last release 2021-09-06 (1803 days) · last repo commit 2023-08-26 · 104 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,657,969 downloads/mo, #2,956 on PyPI
Alternatives
Verify before relying
from readerwriterlock import rwlock
a = rwlock.RWLockFairD()
with a.gen_rlock():
# read operation
pass
with a.gen_wlock():
# write operation
pass- Whether the implementation has been tested against Python versions beyond 3.9 or if there are known compatibility issues with newer releases.
- Real-world performance characteristics and scalability limits compared to alternatives or standard library threading primitives.
- Whether the ~20% performance cost of downgradable locks applies uniformly across all three priority schemes.
What it is and what it does
readerwriterlock is a pure-Python implementation of the three classical reader-writer synchronization problems—a concurrency pattern where multiple readers can hold a lock simultaneously, but writers require exclusive access. The package provides six lock classes: three prioritize readers, writers, or fairness respectively, and three downgradable variants that allow atomically converting a write lock to a read lock (with a documented ~20% performance cost). All classes conform to Python's standard threading.Lock interface, including support for timeouts and context managers.
You instantiate a lock class, then call gen_rlock() or gen_wlock() to create reader or writer lock objects that you acquire and release in your code. The choice of class determines scheduling behavior: reader-priority favors read throughput, writer-priority prevents writer starvation, and fair-priority balances both. The package depends only on typing-extensions and has no system-level dependencies.
Use it for
- Protect a shared cache or in-memory data structure where reads vastly outnumber writes and you want many concurrent readers.
- Implement a fair lock for a resource where both readers and writers must be served without starvation, such as a shared log or configuration store.
- Build a write-heavy system where writer priority prevents reader threads from blocking critical updates indefinitely.
- Use lock downgrading when a thread acquires write access to check-then-update a value, then only needs read access afterward without releasing and re-acquiring.
- Add timeout-based lock acquisition to detect and handle deadlock scenarios in multi-threaded applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a reader-writer lock and are comfortable with an abandoned package.
The implementation is marked Production/Stable with no known vulnerabilities and has 104 GitHub stars, suggesting stability. Reader-writer locks are a well-understood pattern unlikely to require frequent updates. However, verify compatibility with your Python version and consider whether the lack of maintenance is acceptable for your use case.
Install
readerwriterlock on PyPI
Before you install
Low install friction with a single pure-Python dependency. However, the package is abandoned—last release was 2021-09-06 with no recent commits. Use only if you need a stable, unchanging implementation and can maintain it yourself if issues arise.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions, provided you include the license notice.
Quickstart
from readerwriterlock import rwlock
a = rwlock.RWLockFairD()
with a.gen_rlock():
# read operation
pass
with a.gen_wlock():
# write operation
pass
Verify before relying
- Whether the implementation has been tested against Python versions beyond 3.9 or if there are known compatibility issues with newer releases.
- Real-world performance characteristics and scalability limits compared to alternatives or standard library threading primitives.
- Whether the ~20% performance cost of downgradable locks applies uniformly across all three priority schemes.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Abandoned 1,803 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,657,969 / month, #2,956 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: readerwriterlock-1.0.9-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “reader writer lock python”
- readerwriterlockProvides reader-writer lock implementations for Python that solve the…
- aiorwlockProvides read-write locks for asyncio programs, allowing multiple…
- fastenersProvides cross-platform locks for synchronizing access between…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also aiorwlock · fasteners · locket · redlock · zc.lockfile · portalocker · python-dynamodb-lock · fifolock · redlock-py · django-pglock