Age | Commit message (Collapse) | Author |
|
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.
|
|
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
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
|