08.12.2015 18:25, Dimitry Sibiryakov wrote: ... > IMHO, on contrary, it is quite common case when several threads want to > perform an > operation but only is allowed to. > In this topic's example it is running a sweep process. When a thread want > to run it, > there can be two cases: > a) it is the first thread wanting to > b) someone else is already running it > > In first case, the thread atomically set the flag and proceed. > In second case, the thread atomically set the flag and abort. > Result in both cases is exactly the same: flag is set but only first > thread works. > What I'm missing?
You missing existence of more than one flag and needs to coordinate it all together. See my previous message for details. 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