qt5base-lts/tests/auto/gui/kernel
Alex Trotsenko f265c87e01 Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2
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: I66443c3021d6ba98639a214c3e768be97d2cf14b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-02 22:53:06 +02:00
..
noqteventloop Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2 2021-03-02 22:53:06 +02:00
qaction Remove the qmake project files 2021-01-07 15:32:28 +01:00
qactiongroup Remove the qmake project files 2021-01-07 15:32:28 +01:00
qaddpostroutine Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbackingstore Remove the qmake project files 2021-01-07 15:32:28 +01:00
qclipboard Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qcursor Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdrag Remove the qmake project files 2021-01-07 15:32:28 +01:00
qevent Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfileopenevent Fix a few compiler warnings in tests 2021-02-02 12:06:05 +01:00
qguiapplication Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qguieventdispatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguieventloop Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qguimetatype Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguitimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguivariant Remove the qmake project files 2021-01-07 15:32:28 +01:00
qhighdpi High-DPI: Set the minimum scale factor to 1 2021-03-02 13:36:38 +00:00
qinputdevice Remove the qmake project files 2021-01-07 15:32:28 +01:00
qinputmethod Remove the qmake project files 2021-01-07 15:32:28 +01:00
qkeyevent Remove the qmake project files 2021-01-07 15:32:28 +01:00
qkeysequence Remove irrelevant test row, fix compiler warning 2021-01-08 16:37:22 +01:00
qmouseevent Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmouseevent_modal Remove the qmake project files 2021-01-07 15:32:28 +01:00
qopenglwindow Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpalette Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpixelformat Remove the qmake project files 2021-01-07 15:32:28 +01:00
qrasterwindow Remove the qmake project files 2021-01-07 15:32:28 +01:00
qscreen Remove the qmake project files 2021-01-07 15:32:28 +01:00
qshortcut Remove the qmake project files 2021-01-07 15:32:28 +01:00
qsurfaceformat Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtouchevent Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwindow AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinates 2021-01-14 19:09:28 +00:00
CMakeLists.txt Skip tst_qhighdpi when offscreen is not built 2021-01-14 14:21:45 +01:00