Libatomic provides arch-independant API for the low-level atomic implementation. Library supports x86 (both i386 and x86_64), PPC64, Sparc64 (v9 and higher) and with modern gcc (version higher than 4.1.0) and its <code>__sync</code> extensions all its supported platforms.
Library exports platform-dependant <code>atomic_t</code> type and number of API to work with, namely void atomic_set(atomic_t *a, int val) int atomic_add(atomic_t *a, int val); int atomic_sub(atomic_t *a, int val); int atomic_inc(atomic_t *a); int atomic_dec(atomic_t *a); int atomic_dec_and_test(atomic_t *a);
All functions perform atomic operation and return new value of the atomic counter. <code>atomic_dec_and_test()</code> returns true if after decrement counter reached zero.
Library configuration automatically performs architecture detection and selection for the proper low-level atomic implementation. It is easily extensible with new platform-dependant code (both inline and usual asm or C if needed).
Source code is available in <a href="/cgi-bin/gitweb.cgi?p=libatomic.git;a=summary">git</a> tree or <a href="/archive/libatomic">archive</a>.
Recent comments
1 week 3 days ago
1 week 3 days ago
2 weeks 2 days ago
2 weeks 2 days ago
2 weeks 2 days ago
2 weeks 3 days ago
2 weeks 3 days ago
6 weeks 2 days ago
6 weeks 4 days ago
6 weeks 5 days ago