Data synchornization between thread during emit
I have three threads , Main/GUI thread and two worker threads. data flow if from one worker thread to another and then to GU thread for that I am using Slot and Signal mechanism.
I Can share the data in two ways, either define globally and the use mutex to synchronize OR
I can pass the arguments in the slot and emit.
My question is if I pass the arguments ans use queued connection , do these arguments gets copied to local buffer of event queue before getting copied to Slot functions local arguments?
If not then reentrency can cause issues at senders side.
Yes, in case of queued connections parameters passed by value or const reference are copied.