mardi 8 janvier 2019

Problems with boost.interprocess for bicdirectional messaging using message_queue

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 system work for both queues. Depending on the ordering of the process 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. Even the 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 receive 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?

Aucun commentaire:

Enregistrer un commentaire