[英]boost::interprocess::message_queue stops working in Release mode with visual C++
I am using boost::interprocess::message_queue, with VC++ (in Microsoft Visual Studio 2005). 我正在使用带有VC ++的boost :: interprocess :: message_queue(在Microsoft Visual Studio 2005中)。 It is working properly in Debug mode.
它在调试模式下正常工作。 Then when I compile my program in Release mode it stops working, every time I call "try_send" it returns false.
然后,当我在Release模式下编译程序时,它将停止工作,每当我调用“ try_send”时,它将返回false。 I don't understand what could be the settings that are different between Release and Debug mode, and that would make the queue stop working.
我不了解在Release和Debug模式之间可能有什么不同的设置,这些设置会使队列停止工作。
It turns out that my Release version does not do as much logging as the debug one. 事实证明,我的Release版本不像调试版本那样做很多日志记录。 The thread that accumulates the messages in the queue is quicker, which means that the other thread (which flushes the messages) does not catch up.
在队列中累积消息的线程更快,这意味着另一个线程(刷新消息)不会赶上。 In the end the message queue if full.
最后,消息队列已满。 I need to use timed_send to make so that the other thread gets time to catch up.
我需要使用timed_send来使其他线程有时间赶上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.