I have one thread that is waiting in a message queue. Let's call it THFS.
Other threads send messages to this queue, asking for some operations.
These operations need a response. I'm not sure what is the best way to put this response. At first, I thought of putting it in another message queue, but I was not sure how to do it so that the response can link to the correct request. For example, TH1 put msg1, TH2 puts msg2 and they wait for their own response. Then THFS receives these messages and executes the operations requested,then it has to send back the answers.
How to be sure that TH1 and TH2 will receive the answer intended for them?