py-rwmutex
This package provides a simple read/write mutex lock for threads, based upon
the threading package. It supports Python's context manager interface, so
it may be used within with statements.
Purpose
This read/write lock can improve performance by allowing multiple threads to reaad from a shared resource at once. For safety, only one thread is granted a write lock at a time, and only when no threads have a read lock.
Installation
This package is available from PyPi, which
means it can be easily acquired via pip.
Run this command at a shell prompt:
pip3 install rwmutex
Usage
To get started, import the package like so:
from rwmutex import RWLock
Then you can declare a lock object:
lock = RWLock()
To use the lock, you can use with blocks:
with lock.write
# some operation that writes
pass
with lock.read:
# some operation that just needs to read
pass
For a working example, see example.py.
Metadata
Release files for rwmutex 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rwmutex-1.1.tar.gz | 2.3 kB | Without provenance | Details for rwmutex-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rwmutex-1.1-py3-none-any.whl | Python 3 | none | any | Details for rwmutex-1.1-py3-none-any.whl |
Total release size: 5.4 kB
Release files / rwmutex-1.1.tar.gz
| Download URL | rwmutex-1.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8fdc87810aa6b0b7b4c02c1612cc66141e91bd45bad8556e3305cdc2123d393
|
|
BLAKE2b-256 checksum How to use checksums |
7bd7bbbdf48e9f55189533337adfcfa9fa3211a9dab9a1122dca5f0dc22ccc5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.3
|
Release files / rwmutex-1.1-py3-none-any.whl
| Download URL | rwmutex-1.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69a8256ccbd0e061fc8c14892d8d2b3b64d8d8c7b8e6f1abbd607c5147cfb6c7
|
|
BLAKE2b-256 checksum How to use checksums |
139ba1105cb2e6a67d9019563c3240da6a2111112a092799c31ce0017d527f70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.3
|
Security for rwmutex 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.