On 2018-10-15 16:59, Thiago Macieira wrote:
On Monday, 15 October 2018 06:34:55 PDT René J. V. Bertin wrote:
Thiago Macieira wrote:
> Do you realise that the cost of starting a thread is much higher than the
> cost of a pipe? Not to mention that using QThread will create a pipe
> anyway, so you'd need to drop down to low-level primitives (pthread,
> Win32) to get away from it.

OK, that's an argument. I tried to figure that out and didn't see evidence
that QThread *always* creates a pipe. Pity but thanks for confirming.

It's not QThread itself, it's the event dispatcher. Either
QEventDispatcherUNIX, QEventDispatcherGlib or, on a Mac,
QEventDispatcherCoreFoundation. But looking at the sources, it seems that the event dispatcher is created on-demand by the first QEventLoop or by calling
exec(), so the file descriptor won't be opened until then.


It will be created regardless of event loop:

https://code.woboq.org/qt5/qtbase/src/corelib/thread/qthread_unix.cpp.html#342


--
Sérgio Martins | [email protected] | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to