qt5base-lts/tests/auto/corelib/thread
Thiago Macieira 309dacedac Atomics: remove requirement for alignment equality with plain types
This was originally added so that you could replace a T with
QAtomicInteger<T> in the same class and still keep ABI. However, for
legacy reasons, on 32-bit x86, types larger than 4 bytes keep an old
1990s alignment of only 4 bytes, but modern std::atomic<T> for those 8-
byte types enforces an alignment of 8 bytes. Therefore, the requirement
to keep alignment is not possible to guarantee.

In other words: you may not replace T with QAtomicInteger<T> or
std::atomic<T> and assume no ABI breakages in all platforms.

This is a requirement to implement atomicity. An 8-byte type aligned to
only a 4-byte boundary could cross a 16-byte boundary or, worse, cross a
cacheline boundary. Crossing the 16-byte boundary could be bad on some
processors, but crossing the cacheline boundary (addresses ending in
0x3C, 0x7C, 0xCC and 0xFC, or 4 out of 64 possible addresses or 6.25%)
is always bad: the CPUs cannot guarantee an atomic load or store
operation.

See also <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71660>.

Task-number: QTBUG-67858
Change-Id: If90a92b041d3442fa0a4fffd15283e4615474582
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-04-24 17:36:42 +00:00
..
qatomicint Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qatomicinteger Atomics: remove requirement for alignment equality with plain types 2018-04-24 17:36:42 +00:00
qatomicpointer Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qfuture Merge remote-tracking branch 'origin/5.10' into dev 2017-11-23 09:36:03 +01:00
qfuturesynchronizer Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
qfuturewatcher tst_QFutureWatcher: Avoid unconditional qWait()s 2018-04-03 10:20:27 +00:00
qmutex tst_QMutex: produce less noise with MSVC 2017-09-01 16:36:17 +00:00
qmutexlocker Updated license headers 2016-01-21 18:55:18 +00:00
qreadlocker Updated license headers 2016-01-21 18:55:18 +00:00
qreadwritelock Updated license headers 2016-01-21 18:55:18 +00:00
qresultstore Fix UB in QFutureInterface: invalid casts from ResultStoreBase to ResultStore<> 2017-03-06 18:32:28 +00:00
qsemaphore QSemaphore: fix deadlock when the woken up thread wakes up another 2018-03-19 20:36:51 +00:00
qthread tst_QThread: Use QTRY_VERIFY instead of qWaits 2018-04-03 10:20:36 +00:00
qthreadonce QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qthreadpool Merge remote-tracking branch 'origin/5.9' into 5.10 2017-11-23 12:52:18 +01:00
qthreadstorage Use dependencies instead of CONFIG+=ordered 2017-12-02 11:09:15 +00:00
qwaitcondition Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qwritelocker Updated license headers 2016-01-21 18:55:18 +00:00
thread.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00