On Tuesday, 30 May 2023 17:10:11 PDT Ilya Fedin wrote: > On Tue, 30 May 2023 16:55:51 -0700 > > Thiago Macieira <thiago.macie...@intel.com> wrote: > > After trying myself, it turns out the problem is not QTimer or the > > > > event dispatcher, but the Windows API. The following test: > > https://codereview.qt-project.org/c/qt/qtbase/+/480705 > > > > passes on Linux (glib and native), macOS but fails on Windows, all of > > them Core and Gui. > > While talking about Windows timer bugs, want to remind about > QTBUG-95034 which causes crashes in highly concurrent applications > since at least 2 years already.
If we choose to use a single timer source per thread and keep changing its timeout, like we do everywhere else, then it would get fixed. It might be as simple as replacing that INFINITE in: emit aboutToBlock(); MsgWaitForMultipleObjectsEx(0, NULL, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE | MWMO_INPUTAVAILABLE); emit awake(); with a value obtained from QTimerInfoList::timerWait, then calling QTimerInfoList::activateTimers(). This should be easier after the work by Ahmad to use <chrono> in QTimerInfoList lands. QDeadlineTimer is already using std::chrono::steady_clock on Windows. -- Thiago Macieira - thiago.macieira (AT) intel.com Cloud Software Architect - Intel DCAI Cloud Engineering
smime.p7s
Description: S/MIME cryptographic signature
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development