1

I am trying to implement a messaging system between two processes with boost.interprocess and message_queue.

First problem: One queue can only be used for sending messages from process A to B, not B to A.

Thus, I am using two queues in both processes. Process A listens/receives at Queue-A and sends on Queue-B; Process B listens/receives at Queue-B and sends on Queue-A.

I am unable to get the to system work with both queues. Depending on the ordering of the processes calling boost::interprocess::message_queue(boost::interprocess::open_or_create,...) or

boost::interprocess::message_queue(boost::interprocess::open_only,...)

either one Queue works or the other or neither.

Even if Process A creates Queue-A and Queue-B and Process B opens Queue-A and Queue-B, only. In one direction boost::interprocess is stuck at the receive-function and never awakes.

1) Is it possible to get bidirectional messaging/signalling to work with interprocess::message_queue using two queues in each process? 2) Is there a better way get bidirectional messaging without using message_queue?

1 Answer 1

3

I did not receive any comments on this. The solution was to not use boost::interprocess::message_queue. With the help of boost/interprocess/shared_memory_object I did write on my own a new, simple library for unidirectional interprocess messaging. https://github.com/svebert/InterprocessMsg

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.