Skip to main content

AtomicLong

Sometimes you need to increment some numbers … atomically … in python.

AtomicLong was born out of the need for fast thread-safe counters in python.

It uses CFFI to bind GCC’s Atomic Builtins.

Its value is a C long which can be incremented, decremented, and set atomically. It is inspired by Java’s java.util.concurrent.atomic.AtomicLong.

Example:

>>> from atomiclong import AtomicLong
>>> a = AtomicLong(0)
>>> a += 1
>>> a.value
1
>>> a += 10
>>> a.value
11
>>> a.value = 1000
>>> a.value
1000
>>> a -= 100
>>> a.value
900

Metadata

Release files for atomiclong 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atomiclong 0.1.1
File Size Uploaded
atomiclong-0.1.1.tar.gz 5.1 kB Details

Release files / atomiclong-0.1.1.tar.gz

Download URL atomiclong-0.1.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cb1378c4cd676d6f243641c50e277504abf45f70f1ea76e446efcdbb69624bbe
BLAKE2b-256 checksum
How to use checksums
868c70aea8215c6ab990f2d91e7ec171787a41b7fbc83df32a067ba5d7f3324f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page