--- id: fifolock version: "0.0.20" license: unclear license_treatment: permissive maintenance: abandoned --- # fifolock — A flexible low-level tool to make synchronisation primitives in asyncio Python License: permissive · Maintenance: abandoned · Downloads: 236.9K/mo ## What it is and what it does Fifolock is a minimal asyncio synchronization tool that lets you build custom lock types—mutexes, read/write locks, semaphores—by defining compatibility rules between lock modes. Each mode is a subclass of asyncio.Future, and the lock grants access strictly in the order requests arrive, never allowing reentrancy. You create a FifoLock instance, define lock-mode classes with an is_compatible method that checks whether a new request can proceed given the currently held locks, then use the lock as an async context manager. The package includes recipes for common patterns like exclusive locks, shared/exclusive (read/write) locks, and bounded semaphores. It requires Python 3.5 or later and has no external dependencies. Use it for: - Building a read/write lock where multiple readers can access a resource concurrently but writers get exclusive access. - Implementing a bounded semaphore that allows concurrent operations in strict request order. - Creating custom synchronization logic where lock compatibility depends on which modes are currently held. - Ensuring fair, deterministic lock acquisition order in asyncio applications where FIFO fairness matters. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Fifolock provides a low-level building block for creating custom synchronization primitives in asyncio Python, where locks are granted strictly in first-in-first-out order and are not reentrant. No, unless you have an existing codebase already using it. The package is abandoned (last release 2019-05-02, no commits since), and asyncio now includes built-in primitives that cover most common use cases. If you need custom lock semantics, consider maintaining a fork or using a maintained alternative. ## Install pip install fifolock uv add fifolock poetry add fifolock ## Installing fifolock Before you install: Installation is frictionless—a pure Python wheel with no runtime dependencies. However, the project is abandoned; the last commit was 2019-05-02 and no releases have occurred since. License in practice: Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install fifolock import asyncio from fifolock import FifoLock class Mutex(asyncio.Future): @staticmethod def is_compatible(holds): return not holds[Mutex] lock = FifoLock() async def access(): async with lock(Mutex): pass Requires Python 3.5 or later (requires_python: >=3.5) Verify before relying: - Whether the package works correctly with Python versions released after 2019. - Whether there are known issues or edge cases in FIFO lock ordering under high concurrency. - Whether alternative asyncio lock libraries now provide similar functionality. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 236.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio synchronization primitives, fifo lock async python, custom async locks, asyncio mutual exclusion, read write lock asyncio, semaphore asyncio, async lock ordering, asyncio, concurrency, abandoned [View on SkillFed](https://skillfed.io/packages/fifolock) · [View on PyPI](https://pypi.org/project/fifolock/)