Registry / serialization / atomicx

atomicx

JSON →
library0.0.15pypypi✓ verified 34d 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.

serializationdata
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

from atomicx import AtomicInt
from atomicx import AtomicBool
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 footguns
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.
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.
gotchaInitialization with non-integer for AtomicInt may raise TypeError. For AtomicFloat, only float is accepted; passing int may be coerced but not guaranteed.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources