Yes, but this connection is made when you call connect, and not derived dynamically, when you emit the signal.The connect documentation and Qt::AutoConnection state:
"If the signal is emitted from the thread in which the receiving object lives, the slot is invoked directly, as with Qt: DirectConnection; otherwise the signal is queued, as with Qt::QueuedConnection."
So the connection remains Qt:: DirectConnection, even if you call the method that emits the signal from another thread.
No, it gets a direct connection. You could try to force it to QueuedConnection when you call connect but I'm not sure if it will work.By putting both the signal and the slot in the GUI class, calling a member function of the GUI class to emit the signal (and set some variable) from another thread, I should be getting a queue response because the signal is being emitted from a thread which is different from the one where the receiving object is? Am I reading this wrong, that is certainly possible? Just by virtue of the thread in which the SIGNAL is declared, not called, does that change this? Could I also just set these connections up and force them to be queued, since they are unique? My issue is that I would have create these signals and connections in several threads rather than one set of functions in the GUI thread that could be used by all external threads. I can certainly do this, I just want to be sure it is required?
Being a DirectConnection, the slot will get executed in the context of the worker thread.
So if any widgets are modified as a result of this slot, the GUI will block.
But why don't you try my suggestion?
Instead of a GUI method call, just emit a signal from the worker thread. The signal should be connected to the slot in the GUI. There aren't that much modifications to be made( actually they are minimal ).
This way you are guaranteed to have a QueuedConnection, therefore no blocking.
I hope you understand.
Yes, a perfectly good explanation for blocking the GUI. Therefore use a signal instead of calling the GUI thread directly. It is not normal to do that.For other reasons I have been playing with the frequency of the CALLBACKS from ALSA and have noticed that the more frequent the CALLBACKS are occuring, the more quickly my GUI freezes after startup. A 5ms callback rate will freeze within 10 seconds of startup 3 of 5 times. A 10ms callback rate doesn't ever seem to freeze within the first 5 minutes of execution.
No, only the context in which the GUI slot is executed is the problem.Thus my supposition that the CALLBACKs from ALSA, are causing some issue with the GUI thread. I could very well be wrong and your reply may be my issue. I would like to think that it is since I could solve the problem and move on to other work, but it doesn't quite jive with all the data.
Regards




Reply With Quote
Bookmarks