×

This is a C-level implementation of a fast, re-entrant, optimistic lock for CPython. It is a drop-in replacement for threading.RLock. FastRLock is implemented in Cython and also provides a C-API for direct use from Cython code via from fastrlock cimport rlock. Under normal conditions, it is about 10x faster than threading.RLock in Python 2.7 because it avoids all locking unless two or more threads try to acquire it at the same time. Under congestion, it is still about 10% faster than RLock due to being implemented in Cython. This is mostly equivalent to the revised RLock implementation in Python 3.2, but still faster due to being implemented in Cython. Note that the threading.RLock implementation in Python 3.4 and later tends to be as fast or even faster than the lock provided by this package, when called through the Python API. FastRLock is still faster also on these systems when called through its Cython API.

Uploaded Mon Mar 31 21:35:38 2025
md5 checksum 3538276b8ec9ae9b52d0952294ae6c00
arch x86_64
build py310h5eee18b_0
depends libgcc-ng >=11.2.0, python >=3.10,<3.11.0a0
license MIT
license_family MIT
md5 3538276b8ec9ae9b52d0952294ae6c00
name fastrlock
platform linux
sha1 67f68ab9c350c41c65fae2c406c2a096a15a180b
sha256 ce5f26a7426ab37dbf659f86d1edf8e1cbc7c47385df31edcf5b5e45a4daae32
size 36816
subdir linux-64
timestamp 1736260183265
version 0.8.3