What is the recommended way to pass messages both ways between a class and its worker thread, using C++11 & Poco?
I have a class that uses a thread to do some of its work (in particular, so that the thread can read frames from a video file and store them). I am using Poco to create the thread (using Poco::Thread) and the thread handler (using Poco::Runnable). I'm then passing messages by using Poco::Notification from the class to the worker thread. This works fine to send messages one-way from the class to the worker thread.
I also want to send messages back the other way (for example, for the worker thread to tell the parent class that the video can't be opened or that all the frames have been read). Is there a recommended way to do this using the Poco library, and, if so, what it is?
The Poco documentation describes using both Notifications and Events to pass messages. It may be that the right way is to set up two NotificationQueues (one for each direction), or that the best way is for the parent class to send messages to the thread using a NotificationQueue and for the worker thread to send messages back using Poco::Event
Many thanks for any help you can give.