Hi, the current (and the 4.6 snapshot) documentation and examples, about
QAtomicInt (and atomics in general), are a bit short in detail and somewhat
misleading.
First, the is no general "Atomic Operations" section to introduce the reader to
the concept.
Second there no "down to earth" examples, except maybe for ref/unref usage, in
the QAtomicInt documentation itself.
There is a lot of info about "Memory ordering" and "Feature Tests" but no
explanation where, how and why one should be used instead of another.
This fact, and the lack of examples scared me of using *any* function.
Should I use the relax, acquire or ordered version?
What happens if XXX_IS_NOT_NATIVE? And so on.
Also, the docs are a bit misleading in the part:
"Non-atomic convenience operators
For convenience, QAtomicInt provides integer comparison, cast, and
assignment operators. Note that a combination of these operators is not an
atomic operation."
This *combination* makes me think that using comparison, cast, assignment is
OK, they are atomic, but the combination (one after another) is not.
This is probably false, because these are "Non-atomic convenience operators",
but, as I said, its misleading.
Also, if they are NOT-atomic, it should be written explicitly (with fat
WARNING) in every method's documentation.
(It may be lame to think these ARE atomic, but Qt users are not required to
know anything about atomics and how they are implemented)
So in the end I don't have my simple questions answered:
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.
Don't get me wrong, the docs are not *bad*, I understand its a low level
concept,
but right now they are not "in the Qt style" :)
Thank You
MihailNaydenov
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback