oslo.concurrency
Oslo Concurrency library
What it is and what it does
oslo.concurrency is an OpenStack library that abstracts multi-threading and multi-process synchronization for applications that need safe concurrent access to shared resources. It wraps file-based and other locking primitives through fasteners and provides utilities for spawning and managing external processes. The library is part of the Oslo project, a collection of utilities shared across OpenStack services, and is designed for applications that need reliable coordination across multiple execution contexts without building locking logic from scratch.
The package targets Python 3.11+ and is actively maintained. Its dependency on oslo.config, oslo.i18n, oslo.utils, and debtcollector reflects its role as a mid-level utility within the OpenStack ecosystem, though it can be used standalone in any Python application that needs distributed or file-based locking. The permissive Apache-2.0 license and typed codebase make it suitable for both open-source and proprietary projects.
Use it for:
- Protect critical sections in multi-threaded applications using file-based locks that survive process restarts.
- Coordinate resource access across multiple independent processes or services without a centralized lock server.
- Manage external subprocess execution with built-in utilities for spawning and monitoring child processes.
- Implement distributed locking in OpenStack services or other cloud applications that need reliable synchronization.
- Enforce mutual exclusion in long-running daemon applications where lock state must persist across restarts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oslo.concurrency provides locking mechanisms and external process utilities for safely running multi-thread and multi-process applications.
Yes, if you need file-based or distributed locking in a multi-process or multi-threaded application and are comfortable with the Oslo dependency chain. The library is actively maintained, has no known vulnerabilities, and offers low install friction. No, if you require a lighter-weight locking solution without OpenStack dependencies or if your Python version is below 3.11.
Install
oslo-concurrency on PyPI
pip
pip install oslo-concurrencyuv
uv add oslo-concurrencypoetry
poetry add oslo-concurrencyInstalling oslo.concurrency
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (29 days ago). Depends on six Oslo libraries (pbr, oslo.config, oslo.i18n, oslo.utils, fasteners, debtcollector), which are standard in OpenStack ecosystems but add a moderate dependency chain.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for proprietary applications.
Quickstart
pip install oslo.concurrency
from oslo_concurrency import lockutils
with lockutils.lock('my-lock'):
# Critical section protected by lock
pass
Requires Python 3.11 or later; oslo.concurrency depends on fasteners, which may require system libraries for file locking on some platforms.
Verify before relying
- Whether fasteners' system-level dependencies (if any) are documented or could affect installation on non-Linux POSIX systems.
- Performance characteristics and scalability limits for distributed locking across many processes or machines.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — pbr, oslo.config, oslo.i18n, oslo.utils, fasteners, debtcollector |
| Maintenance | actively maintained — 29 days since the last release |
| First released | |
| Downloads | 549,788/month — #6,053 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oslo_concurrency-7.6.1-py3-none-any.whl
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
oslo.policyoslo.policy enforces role-based access control…
permissive · top 15,000 on PyPI
toozTooz provides a coordination API for…
permissive · top 15,000 on PyPI
django-concurrencyAdds optimistic locking to Django models to…
permissive · top 15,000 on PyPI
oslo.vmwareoslo.vmware provides a library for common…
permissive · top 15,000 on PyPI
oslo.utilsoslo.utils provides common utility functions…
permissive · top 5,000 on PyPI
concurrent-log-handlerProvides thread-safe and process-safe logging…
permissive · top 5,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI
oslo.messagingOslo Messaging provides a unified API for RPC…
permissive · top 15,000 on PyPI
oslo.privseposlo.privsep helps applications safely perform…
permissive · top 15,000 on PyPI