[Development] performance of signal slots across threads

Nguyen Huu Minh HuuMinh.Nguyen at vandewiele.com
Tue Feb 25 17:22:33 CET 2014


Hi,

I am developing a cross platform application on Windows Xp embedded and on Ubuntu 12.04 using Qt 5.2.1. This application makes use of signal slot communication between QObjects living in different threads (worker and GUI).
The separation of threads is needed because one of the QObjects handles the communication to a hardware device, whereas the other one processes data required the hardware and other components.

My main development platform is Windows and testing there show that everything is fine.
However, compiling the same code base on Linux I notice very slow performance on Ubuntu due to the signal slot inter-thread communication.
If I use the same code and same QObjects, but this time living in the same thread on Ubuntu, the performance is fine again.

To give you a rough idea, on Ubuntu inter-thread communication takes ~43s for the test code, intra-thread communication ~7s. On Windows in both case I get around ~6s (give or take).

I realize that using signal slots entails some overhead, I am just surprised by the amount the overhead it seems to create on Ubuntu and the fact that is overhead is almost non-existent on Windows.

Can anyone give me some insights as to why this is or solutions/workarounds to this phenomenon?

Kind regards,

Minh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140225/6ed7c403/attachment.html>


More information about the Development mailing list