
13 Jun
2011
13 Jun
'11
12:10 p.m.
Hi, Thanks for your reply.
No, you shouldn't use these macros. They are Windows-specific and correspond to InterlockedIncrement/InterlockedDecrement but don't require the inclusion of windows.h. If you are targeting the new C++0x, use std::atomic; otherwise, until Boost.Atomic is available, you may try boost::detail::atomic_count. It's, however, undocumented.
I am using boost::detail::atomic_count now. I saw it is implemented using a scoped_lock for pthreads. Is there any advantage of using C++0x in terms of performance on Linux? Cheers, Andrej