Registry / serialization / atomicx

atomicx

JSON →
library0.0.15pypypi✓ verified 84d ago

Easy-to-use lock-free atomic integers, booleans, and floats for Python, leveraging C11 atomics. Current version 0.0.15, requires Python >=3.8. Released under MIT license, primarily a single-developer project with infrequent releases.

pip install atomicx
INSTALL
IMPORT
SIG · ATOMICX
A
atomicx
serializationpythonv0.0.15
Install
1.6s avg
Import
Disk
17MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.15 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AtomicInt
from atomicx import AtomicInt
AtomicBool
from atomicx import AtomicBool
AtomicFloat
from atomicx import AtomicFloat

Create and use atomic types with load/store and arithmetic operations.

from atomicx import AtomicInt, AtomicBool, AtomicFloat counter = AtomicInt(0) counter.inc() counter.add(5) print(counter.load()) flag = AtomicBool(False) flag.store(True) print(flag.load()) value = AtomicFloat(3.14) print(value.load())
Debug
Known issues
gotchaAtomicFloat does not support compound assignment operators like += because Python float operations are not atomic. Always use methods like .store() or .add() (if available) to modify the value.
fix
Use atomic_float.store(atomic_float.load() + 1) or check if .add() is implemented in your version.
affects: all
gotchaAtomic types do not support comparison or arithmetic across threads without explicit load; comparing two atomic objects directly compares their memory addresses, not their values.
fix
Always use .load() to get the value before comparing: if atomic_a.load() == atomic_b.load(): ...
affects: all
gotchaInitialization with non-integer for AtomicInt may raise TypeError. For AtomicFloat, only float is accepted; passing int may be coerced but not guaranteed.
fix
AtomicInt(0) works; AtomicFloat(0.0) works; AtomicFloat(0) may raise TypeError.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'atomicx'
Package not installed or installed in a different environment.
fix
Run 'pip install atomicx' to install the package.
ImportError: cannot import name 'AtomicFloat' from 'atomicx'
Version older than 0.0.15 may not have AtomicFloat; introduced in 0.0.15.
fix
Upgrade atomicx: 'pip install --upgrade atomicx'. Or import only available classes: AtomicInt and AtomicBool.
TypeError: 'AtomicInt' object does not support item assignment
Trying to use subscript notation like atomic[0] instead of atomic.load() or atomic.store().
fix
Use .load() to read and .store(value) to write.
Upgrade
Version history
0.0.15latest on PyPI · released Sep 28, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
atomicx — pip install atomicx · libregistry