You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 24, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 24, 2022. It is now read-only.
It seems like shctx.c is written with several inline assembler parts to get atomic operations. GCC has a relatively rich set1 of these; possibly not everything that the file needs, but at least the cmpxchg() function could probably be replaced by __sync_val_compare_and_swap().
__sync_val_compare_and_swap gcc builtin appear in gcc v4.1.* . My embedded solution product, as a lot of embedded solutions, use a gcc v3 based toolchain.
If the assembled code is a problem, pthread_mutex usage is more portable.
Activity
EmericBr commentedon Feb 20, 2012
__sync_val_compare_and_swap gcc builtin appear in gcc v4.1.* . My embedded solution product, as a lot of embedded solutions, use a gcc v3 based toolchain.
If the assembled code is a problem, pthread_mutex usage is more portable.
EmericBr commentedon Aug 24, 2012
#109 use atomic ops sync built-ins in fallback if current arch does not support x86 asm (built-ins atomics op implementation is less optimized).