multithreading - Fencing in old C++ compilers -
i have multithreaded application need compile on gcc 4.4, not allowed use c++0x flag.
i want variable behave atomically unfortunately w/o c++0x flag unable use atomic<t>
in c++.
i tried boost::atomic
gives me error saying
iso c++ forbids declaration of "atomic" no type
is there other way achieve atomicity under these conditions, can use fencing - if yes there guide or commonly used commands achieve fencing in old c++.
as advised sam varshavchik in comments above, using posix std::mutex can protect variable in multithreaded application.
std::mutex overkill it's best have gcc 4.4.
c++11 atomic better job @ solving issue available on more recent compilers.