Thank You for Your answer, but it was not helpful to me. Anyway, after a couple of hours researching I found the necessary information. I post it here for reference for the others in need.
Here the 3 links that pretty much solve it all: Synchronization and Multiprocessor Issues http://msdn.microsoft.com/en-us/library/ms686355%28VS.85%29.aspx This is an introduction to the problem with an example. Interlocked Variable Access http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx Ok, this is the actual documentation of the win api atomic functions, but has some nice general explanantions including on the issue of memory ordering semantics and their usage, and why atomics are needed in the first place. Double-Checked Locking, Threads, Compiler Optimizations, and More http://www.nwcpp.org/Downloads/2004/DCLP_notes.pdf This is a Scott Meyers (Effective C++) take on the topic. It targets a concrete problem, but from here one can learn more than the two other articles combined :) (Especially on Memory Barriers) MihailNaydenov ----- Original Message ---- > From: Thiago Macieira <[email protected]> > To: [email protected] > Sent: Sunday, October 4, 2009 10:35:24 AM > Subject: Re: [Qt4-preview-feedback] QAtomicInt documentation need some work > > Em Sábado 3. Outubro 2009, às 17.13.48, você escreveu: > > Can I use QAtomicInt as "an Int with basic operations being atomic": > > like getting, setting its value. Returning it from a function. > > If not, when and how can I use it. > > int is already atomic in those operations. > > QAtomicInt introduces new atomic operations: fetch-and-add, test-and-set and > fetch-and-set. As for the memory ordering semantics, you had better read a > book. > > -- > Thiago Macieira - thiago.macieira (AT) nokia.com > Senior Product Manager - Nokia, Qt Development Frameworks > Sandakerveien 116, NO-0402 Oslo, Norway > > Qt Developer Days 2009 | Registration Now Open! > Munich, Germany: Oct 12 - 14 San Francisco, California: Nov 2 - 4 > http://qt.nokia.com/qtdevdays2009 _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
