summaryrefslogtreecommitdiff
path: root/src/atomic_counter.hpp
AgeCommit message (Collapse)Author
2012-04-29atomic: prever inline asm over GCC builtins for armv7aAndrew W. Nosenko
As per Patrick Trantham comment http://groups.crossroads.io/r/topic/510xaadGgWVcXFdATnhAuN the GCC __sync_*() builtins are more generic but slower than specialized hand-written assembly for armv7a case. Therefore, the code is reordered for prefer inline assembly for armv7a over GCC builtins. * src/atomic_counter.hpp: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Prefer armv7a specific inline asm over GCC __sync_*() builtins.
2012-04-29atomic: revisit the atomic operation checks and their usageAndrew W. Nosenko
* configure.ac: Check for working Solaris/NetBSD-style atomic.h independly on OS. Add check for GCC-style __sync_*() builtins. New defines: XS_ATOMIC_GCC_SYNC, XS_ATOMIC_SOLARIS. Removed define: XS_FORCE_MUTEXES. * src/atomic_counter.hpp: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Use result of these checks. Preference order: 1. GCC-style __sync_*() builtins 2. Inline asm (x86, x86-64, armv7a) 3. Solaris/NetBSD-style atomic.h, Windows-specific API 4. Fallback to mutex-based implementation
2012-04-29atomic: prefer GCC __sync_*() builtins over inline asmAndrew W. Nosenko
Use GCC __sync_*() builtins when compiler claims to be GCC (GCC itself, Clang...) It can be disabled explicitly by using XS_DISABLE_GCC_SYNC_BUILTINS define. Just for any case. * src/atomic_counter.hpp [__GNUC__ && !XS_DISABLE_GCC_SYNC_BUILTINS]: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp [__GNUC__ && !XS_DISABLE_GCC_SYNC_BUILTINS]: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Prefer GCC __sync_*() builtins over inline asm.
2012-04-29Implement atomic operations for armv7aPatrick Trantham
This commit implements atomic operations for the armv7a architecture using gcc inline assembly. This offers higher performance compared to pthread mutexes. Tested on an am3517 evm, clocked at 600MHz: ./inproc_thr 200 1000000 ------------------------ 53-60K messages / sec, pthread mutexes 73-90K messages / sec, assembly atomic ops ./inproc_lat 200 1000000 ------------------------ average latency: 42.234 [us], pthread mutexes average latency: 35.496 [us], assembly atomic ops
2012-02-16Full name of the project used in license headersMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16ZeroMQ renamed to CrossroadsMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01Copyright dates adjusted to reflect realityMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31250bpm copyrights addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02The copyrights in file headers updated.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-13Make cppcheck not complain about "'operator=' should return something"Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-30Name of "GNU Lesser Public License" corrected.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-05-12Revert commit 7cb076e, atomic ops cleanupMartin Lucina
Reverted to using atomic.h on NetBSD Removed GNU builtins (see http://lists.zeromq.org/pipermail/zeromq-dev/2010-May/003485.html) Removed SPARC native atomic ops as they are untested and have been commented out for years Add "memory" to asm clobber for X86 atomic_counter::sub()
2010-04-29Defer NetBSD atomic ops to GCC builtins. Revert Sun atomic ops #define.Steven McCoy
2010-02-18Add NetBSD supportMartin Lucina
2010-01-05Copyrights transferred from FastMQ to iMatixMartin Sustrik
2009-12-10errors are never predicted in branch prediction (likely/unlikely macros added)Martin Sustrik
2009-08-03renamed from zs to zmqMartin Sustrik
2009-07-29initial commitMartin Sustrik