Dear all,

I use the message queue. I create a queue inside a thread (called Thread A)  and I use it in another thread (called Thread B).
I get this error:  Cannot Allocate memory.

This is the code related to the Thread A:

    message_queue::remove(InterprocessQueueName.c_str());
    message_queue     mq(open_or_create,InterprocessQueueName.c_str(),MAX_INTERPROCESS_SEND_QUEUE_SIZE,CalculatingSizeStructure::maxSizeHMIExtMessage);

     for(;;)
    {
        try
        {
            unsigned int priority;
            std::size_t recvd_size;

            mq.receive(msgBuffer, CalculatingSizeStructure::maxSizeHMIExtMessage, recvd_size, priority);

...
}
catch (interprocess_exception &ex)
{
...
}
}

This is the code related to the Thread B:

            boost::interprocess::message_queue *mq = InterprocessQueueManager::getInstance()->openQueue("Library_Queue");
                if((mq->try_send(&msgCmdSendStatusToLibraryInfoR,sizeof(LibraryInfo),0))==false)
                {...
                }


I've looked for that exception, and  it seems to be related to the POSIX queue. I've also tried some solutions without results.

Any ideas?

Thanks in advance,

Best Regards

Antonio