Yesterday, I closed task 168853, the "provide a cross-platform atomic API" task. After several rounds of API review (and literally hundreds of completely Qt rebuilds on every test machine), I added QAtomicInt and QAtomicPointer to the 4.4 snapshots. These classes provide atomic operations for integers and pointers, respectively. At the moment, each class supports atomic test-and-set, fetch-and-store, and fetch-and-add. QAtomicInt also supports atomic reference counting with the ref() and deref() functions.
In addition to the actual atomic API, QAtomicInt and QAtomicPointer also provide an API to check whether the hardware supports a particular operation natively, and if the implementation is wait-free. For example, there's the monstrous Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NATIVELY_SUPPORTED and Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE macros for compile-time checking, and QAtomicInt::isReferenceCountingNative() and QAtomicInt::isReferenceCountingWaitFree() for run-time checking. Note that run-time checking is really only needed if Q_ATOMIC_INT_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE is defined. This gives us, for example, the possibility of building a generic ARM binary that runs on today's Xscale processors (ARMv5) or an ARMv6 processor (which adds load-linked/store-conditional instructions to support multi-processor/multi-core devices).
So, go get the 4.4 snapshot and give it try. Any and all feedback is welcome :)
Download the latest release here: www.qt.io/download.
Qt 6 was created to be the productivity platform for the future, with next-gen 2D & 3D UX and limitless scalability.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.
Want to build something for tomorrow, join #QtPeople today! We have loads of cool jobs you don’t want to miss! http://qt.io/careers #builtwithQt #software #developers #coding #framework #tool #tooling #C++ #QML #engineers #sales #tech #technology #UI #UX #CX #Qt #Qtdev #global #openpositions #careers #job
Henkilön Qt (@theqtcompany) jakama julkaisu