[Interprocess] message queue Cannot Allocate Memory

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

El 07/12/2012 12:34, cons_Pavignani, Antonio escribió:
I've looked for that exception, and it seems to be related to the POSIX queue. I've also tried some solutions without results.
Interprocess msg queue does not use posix queues. The queue is mapped on shared memory, maybe the size your are requesting might be too big. You'll need to track the code with the debugger to see where exactly the exception is thrown. Best, Ion
participants (2)
-
cons_Pavignani, Antonio
-
Ion Gaztañaga