On 5/14/2013 11:35 PM, Tim Blechmann wrote:
I noticed today when moving my work from OS X / clang / libc++ to iOS / clang / libc++ that Boost.Lockfree must link against libboost_atomic.a to compile. This shouldn't be necessary, since there is std::atomic on iOS as well.
This is true if you're compiling with -std=gnu++11. It's possible to compile for iOS without std::atomic being available with gcc and clang. The point still stands though, it'd be good to use std::atomic if it's available.
i don't have access to this specific toolchain, so it is probably using boost::atomic instead of std::atomic ... however please note that linking with boost.atomic means that the data structure that you want to use is not going to be lock-free, but atomics are emulated via spin locks.
Why's that?