Atomic Sequence
A lock-free, thread-safe sequence/counter which uses the C++ atomic library under the hood. This gives a ~5-10x speed up compared to threading locks.
Install
pip install atomic-sequence
Usage
from atomicsequence import Sequence
sequence = AtomicSequence(0)
# set current sequence value to 1
sequence.set(1)
# get current value
value = sequence.get()
# increment the sequence value and get the new value
value = sequence.increment_and_get(1)
# increment the sequence value and get the value directly preceding the operation
value = sequence.get_and_increment(1)
Testing
To run unittests and benchmarks use tox:
pipenv install --dev
pipenv run tox
Metadata
Release files for atomic-sequence 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| atomic-sequence-0.0.9.tar.gz | 304.9 kB | Without provenance | Details for atomic-sequence-0.0.9.tar.gz |
Release files / atomic-sequence-0.0.9.tar.gz
| Download URL | atomic-sequence-0.0.9.tar.gz |
|---|---|
| Size | 304.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb8cd33d4dfcb7decfafc1c36e6babbd5c48963ecd41e4a55a97fb17a1bbbe10
|
|
BLAKE2b-256 checksum How to use checksums |
be102334abd182a9d343fece1d6a68d5a182b693a3dc3769a554b4ec0e7cf258
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.6.11
|
Security for atomic-sequence 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.