This is a C-level implementation of a fast, re-entrant, optimistic lock for CPython

Installers

Info: This package contains files in non-standard labels.

conda install

  • linux-ppc64le  v0.7
  • linux-64  v0.7
  • linux-aarch64  v0.6
  • osx-64  v0.7
  • win-64  v0.7
To install this package with conda run one of the following:
conda install -c conda-forge fastrlock
conda install -c conda-forge/label/gcc7 fastrlock
conda install -c conda-forge/label/cf201901 fastrlock
conda install -c conda-forge/label/cf202003 fastrlock

Description

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.


© 2021 Anaconda, Inc. All Rights Reserved. (v2.35.6 452d88d2) Legal | Privacy Policy