{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/5"}],"enrichment":{"capability":"A C-level re-entrant lock for CPython that replaces threading.RLock with faster acquire/release cycles through optimistic locking and Cython implementation.","skillfed_tags":["concurrency","cython-extension","performance-critical"],"use_cases":["Replace threading.RLock in latency-sensitive single-threaded or lightly-contended code paths where lock overhead matters.","Use the Cython C-API from other Cython extensions to avoid Python call overhead in critical sections.","Embed in libraries like Lupa that require fast, re-entrant synchronization primitives across multiple threads.","Benchmark-driven optimization where profiling shows threading.RLock as a bottleneck in acquire/release-heavy workloads."],"what_it_does":"FastRLock is a Cython-implemented re-entrant lock that serves as a drop-in replacement for threading.RLock. It optimizes for the common case where only one thread holds the lock by avoiding actual lock acquisition until a second thread contends for it, exploiting the GIL to make ownership checks atomic without system-level synchronization overhead.\n\nThe package provides both a Python API (compatible with threading.RLock) and a direct Cython C-API for use from other Cython modules. Benchmarks show it can be faster than stdlib RLock in single-threaded scenarios and under light contention, though performance relative to modern Python 3.4+ stdlib implementations varies by CPython version and optimization level. The Cython interface consistently outperforms the Python API by avoiding call overhead.","worth_installing":"Yes, if you are optimizing a Cython codebase or have profiled threading.RLock as a bottleneck and target Python versions where it remains faster than stdlib. No, if you are on Python 3.4+ and using only the Python API\u2014stdlib RLock is likely as fast or faster. The Cython API is the strongest use case. Install friction is moderate due to compilation, but wheels cover most platforms."},"id":"fastrlock","links":{"html":"https://skillfed.io/packages/fastrlock","md":"https://skillfed.io/packages/fastrlock.md","pypi":"https://pypi.org/project/fastrlock/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-12-17","license_spdx":null,"license_treatment":"permissive","name":"fastrlock","python_support":"unspecified","summary":"Fast, re-entrant optimistic lock implemented in Cython"},"popularity":{"monthly_downloads":1221732,"position":4201,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.8.3"}
