{"id":18375748,"url":"https://github.com/benjetson/py-rwmutex","last_synced_at":"2026-04-30T07:40:56.671Z","repository":{"id":62584463,"uuid":"326859904","full_name":"BenJetson/py-rwmutex","owner":"BenJetson","description":"Provides a threading read/write mutex lock usable with context managers.","archived":false,"fork":false,"pushed_at":"2021-01-05T03:57:17.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T04:39:43.632Z","etag":null,"topics":["mutex","python","python3","threading","threading-synchronization"],"latest_commit_sha":null,"homepage":"https://www.bengodfrey.net/py-rwmutex/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenJetson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-05T02:07:12.000Z","updated_at":"2023-04-15T01:18:17.000Z","dependencies_parsed_at":"2022-11-03T21:58:11.173Z","dependency_job_id":null,"html_url":"https://github.com/BenJetson/py-rwmutex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenJetson%2Fpy-rwmutex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenJetson%2Fpy-rwmutex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenJetson%2Fpy-rwmutex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenJetson%2Fpy-rwmutex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenJetson","download_url":"https://codeload.github.com/BenJetson/py-rwmutex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345272,"owners_count":21088241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mutex","python","python3","threading","threading-synchronization"],"created_at":"2024-11-06T00:20:11.268Z","updated_at":"2026-04-30T07:40:56.642Z","avatar_url":"https://github.com/BenJetson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-rwmutex\n\nThis package provides a simple read/write mutex lock for threads, based upon\nthe `threading` package. It supports Python's context manager interface, so\nit may be used within `with` statements.\n\n## Purpose\n\nThis read/write lock can improve performance by allowing multiple threads to\nreaad from a shared resource at once. For safety, only one thread is granted\na write lock at a time, and only when no threads have a read lock.\n\n## Installation\n\nThis package is available from [PyPi](https://pypi.org/project/rwmutex/), which\nmeans it can be easily acquired via [`pip`](https://pypi.org/project/pip/).\n\nRun this command at a shell prompt:\n\n```bash\npip3 install rwmutex\n```\n\n## Usage\n\nTo get started, import the package like so:\n\n```py\nfrom rwmutex import RWLock\n```\n\nThen you can declare a lock object:\n\n```py\nlock = RWLock()\n```\n\nTo use the lock, you can use `with` blocks:\n\n```py\nwith lock.write\n    # some operation that writes\n    pass\n\nwith lock.read:\n    # some operation that just needs to read\n    pass\n```\n\nFor a working example, see [example.py](example.py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjetson%2Fpy-rwmutex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjetson%2Fpy-rwmutex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjetson%2Fpy-rwmutex/lists"}