PDA

View Full Version : How to send data from one thread to another thread using Signals and slots mechanism?



activeLearner
18th May 2021, 19:05
I have searched a lot on the internet about this topic but I could not find a proper solution. So here are my requirements:
I would be creating two threads - GUI Thread and another worker thread. In the worker thread, I will be using Posix UDP functions i.e. "recvFrom()" and "sendTo()". My intention is to handle the blocking call "recvFrom()" in the worker thread while my GUI thread will be responsive. Everything is fine but my only issue here is to find a way to send data (specifically structure within a structure) to between the threads. Also, I am creating the worker thread that will be a Posix thread but not QThread.