Reputation: 1766
I am implementing inter process communication using Boost Interprocess. As a test I took the example from the boost documentation.
The first process (which creates the message queue) starts the other (which should receive the messages from the queue) using CreateProcess(NULL, (LPSTR)commandStream.str().c_str(), NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi)
The first process creates the queue using message_queue mq(create_only, "message_queue", 100, sizeof(int))
.
Unfortunately, message_queue mq(open_only, "message_queue")
throws an interprocess_exception
. The exception contains the description Das System kann die angegebene Datei nicht finden. (The system can't find the requested file).
When the queue's creation and opening is both done in one single process, no exception is thrown and the communication works as described in the documentation.
Does someone know what could cause the exception and how I can solve it?
Edit: I am using Boost 1.45
Upvotes: 1
Views: 2929
Reputation: 1766
The exception is caused by a problem in the Boost Interpocessing library as described in this ticket. The bug has been reopened and it is not totally clear to me how the Boost code has been changed and how a workaround could be applied for Boost 1.45. However, after upgrading to Boost 1.51 I am now able to use the Message Queue as expected.
Upvotes: 2