Callback mechanism is a popular concept in multithreading and elsewhere too. There are many resources for it online. Would be more easy to learn about it that way rather than posting all the details here
I understand what you are talking about.
I'm wondering about proper way to integrate them for my issue.
Example:
GUI sends from thread1, request1, then start waiting for reply1.
In the same time GUI sends from thread2, request2, but it don't wait to reply (but as soon as it arrives from Engine, GUI should for example notify user)
Then Engine, pops, let's say, request1, but before sending reply1, it sends others replies(like result1, result2, result3...) after which it finally sends reply1.
Same can happens with thread2.
So, i'm trying to say, that i don't need single request-response. I need also to be able to operate over others replies from Engine.