08.12.2015 16:09, Dimitry Sibiryakov wrote: > 08.12.2015 14:56, Vlad Khorsun wrote: >> Do you see the principal difference with Firebird asm code i show ? > > Principal difference - no. Size difference - yes.
If we will support all existing intrinsic - do you think our code will be smaller ? I speak about AtomicCounter class. >> Do you see the loop with compare_exchange ? > > Yes. > >> Do you see the "lock or" operation ? > > Yes. I speak about case when return value *is used* by caller. Code in link make two calls of "atomic or", later one is not relevant here. >> Do you still have questions ? > > Yes: why to write 6 lines of code instead of two? > > if ((dbb_flags.interlockedOr(DBB_sweep_starting) & (DBB_sweep_in_progress | > DBB_sweep_starting)) > || (dbb_ast_flags & DBB_shutdown)) > return false; This code is not the same as code that you blamed and it is not correct at all. Regards, Vlad ------------------------------------------------------------------------------ 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