08.12.2015 12:29, Vlad Khorsun wrote: > Note, with MSVC, when return value of _InterlockedOr() intrinsic is used > by the caller, compiler will > generate almost the same code as above (with a loop and compare_exchange).
Yes, but they do it on assembler level. > But __sync_fetch_and_or() give us no guarantee because it perform two actions > which is not atomic together. It does guarantee (otherwise "atomic" in the name has no sense). Assembler code produced by __atomic_fetch_or(__ATOMIC_SEQ_CST) is exactly the same as for _InterlockedOr(). -- WBR, SD. ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel