Increase message queue

I have the following boost :: interprocess :: message_queue question.

As expected, I plan to use a message queue between> = 2 processes. Obviously, one of them may fail in the message queue. As a result, it will hold internal locks, making the queue inaccessible to other processes. How can this be solved? There seems to be no way to unlock the used internal mutex.

+5
source share
1 answer

Can we use the predicate wait method in other processes (1 min or more, depending on the requirement), then if it satisfies, then forcibly unblock the queue for the second process, and then block it for pressing and unlocking after reading?

See below for more details.

http://en.cppreference.com/w/cpp/thread/condition_variable/wait

Edit:

We cannot unlock internal locks, I thought you manually block the queue using

scoped_lock lock (mutex);

This way you can unlock using predicate_wait when you are done, then open it. from another process.

0
source

All Articles