文件名称:AtomicPlus:python原子案例及更多
文件大小:2KB
文件格式:ZIP
更新时间:2024-05-17 07:17:36
Python
原子加 注意 Not support multiprocessing, because multi process has each signal memory space ! 安装: pip install effi 基本实施 __sync_add_and_fetch(); __sync_sub_and_fetch(); __sync_bool_compare_and_swap(); __sync_val_compare_and_swap(); 例子: from atomicplus import AtomicCounter a = AtomicCounter(0) def base_test(): base = AtomicCounter(0) assert base.value == 0 base += 1 base -= 1 asser
【文件预览】:
AtomicPlus-master
----test.py(710B)
----README.md(1KB)
----atomicplus.py(2KB)