I understand that this group is only for issues related to the ndk.
I'm posting this question to this group because I saw a very similar
thread on this group and wanted some clarifications.
I need to use atomic increment, decrement, swap and cmpxchg
instructions in android userspace. I found 2 implementations for
these:
a) bionic/libc/include/sys/atomics.h
b) system/core/include/cutils/atomic.h
My questions are:
1) Can a) be used for implementing atomic operations in userspace? If
not, why?
2) If I use b), what is the equivalent of the gcc built-in
sync_lock_test_and_set (atomic exchange) instruction in b)?
3) What is the difference between the two implementations a) and b)?
When should we use which?
I'm not using the ndk toolchain, but the standard android toolchain.
Thanks,
Sushmita
Hi,
I understand that this group is only for issues related to the ndk.
I'm posting this question to this group because I saw a very similar
thread on this group and wanted some clarifications.
I need to use atomic increment, decrement, swap and cmpxchg
instructions in android userspace. I found 2 implementations for
these:
a) bionic/libc/include/sys/atomics.h
b) system/core/include/cutils/atomic.h
My questions are:
1) Can a) be used for implementing atomic operations in userspace? If
not, why?
2) If I use b), what is the equivalent of the gcc built-in
sync_lock_test_and_set (atomic exchange) instruction in b)?
3) What is the difference between the two implementations a) and b)?
When should we use which?
I'm not using the ndk toolchain, but the standard android toolchain.
Thanks,
Sushmita
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
-Sushmita