[InterProcess] receiving notification when an item is added to the message queue
Good afternoon, I am looking to use the message queue in the Interprocess library to communicate between two Windows processes. I was wondering whether there was an in-built mechanism to signal to the process reading from the queue that a message is available for consumption. If there isn't anything in-built, I was wondering what the best way to do this is and whether anybody has any working sample code they would be willing to share? Any help appreciated as always. Kind regards Sean.
On 10/07/2020 17:07, Sean Farrow via Boost-users wrote:
Good afternoon,
I am looking to use the message queue in the Interprocess library to communicate between two Windows processes.
I was wondering whether there was an in-built mechanism to signal to the process reading from the queue that a message is available for consumption.
No, there isn't.
If there isn’t anything in-built, I was wondering what the best way to do this is and whether anybody has any working sample code they would be willing to share?
If the notification has to be asynchronous, then you need to use os-specific mechanism, like signals. If you need to support Windows, then you need to use windows-specific mechanisms, you can look alternatives to signals here: https://docs.microsoft.com/en-us/previous-versions/ms811896(v=msdn.10)?redir... Another way is to launch a background thread and check for an interprocess-mechanism like a named semaphore or similar and notify internally your processing thread to check the message queue. Not simple, but I can't think about any easy alternative. Best, Ion
participants (2)
-
Ion Gaztañaga
-
Sean Farrow