qt6-bb10/tests/auto/gui/kernel
Alex Trotsenko ee122077b0 Allow QWindowsPipe{Reader,Writer} to work with foreign event loops
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution , but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I1cd87c07db39f3b46a2683ce236d7eb67b5be549
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-17 12:45:50 +02:00
..
noqteventloop Allow QWindowsPipe{Reader,Writer} to work with foreign event loops 2020-11-17 12:45:50 +02:00
qaction CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qactiongroup CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qaddpostroutine CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qbackingstore CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qclipboard Rename the new platform APIs from QPlatformInterface to QNativeInterface 2020-10-07 13:03:27 +02:00
qcursor CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qdrag CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qevent CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qfileopenevent CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qguiapplication CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qguieventdispatcher CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qguieventloop CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qguimetatype Rename the QMetaType::MovableType flag to RelocatableType 2020-10-23 09:49:36 +02:00
qguitimer CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qguivariant Update tst_qguivariant to use QMetaType 2020-10-28 22:18:45 +01:00
qhighdpi Android: exclude failing tests of tst_qhighdpi 2020-11-16 13:35:46 +02:00
qhighdpiscaling Merge existing tst_qhighdpiscaling into tst_qhgihdpi 2020-10-20 07:27:04 +02:00
qinputdevice CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qinputmethod CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qkeyevent CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qkeysequence Fix compile warnings from ignored return value 2020-10-17 08:21:52 +02:00
qmouseevent Stop copying events in tests 2020-11-12 15:25:06 +01:00
qmouseevent_modal CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qopenglwindow CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qpalette CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qpixelformat CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qrasterwindow CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qscreen Android: blacklist a list of failing tests for android 2020-11-04 12:27:49 +02:00
qshortcut CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qsurfaceformat CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qtouchevent Stop copying events in tests 2020-11-12 15:25:06 +01:00
qwindow tests: Blacklist tst_qwindow failing test on Windows 2020-11-07 19:33:37 +01:00
.prev_CMakeLists.txt CMake: Skip / ignore failing tests on CMake platforms 2020-07-01 14:55:29 +02:00
CMakeLists.txt Merge existing tst_qhighdpiscaling into tst_qhgihdpi 2020-10-20 07:27:04 +02:00
kernel.pro Merge existing tst_qhighdpiscaling into tst_qhgihdpi 2020-10-20 07:27:04 +02:00