简体   繁体   English

boost :: interprocess :: message_queue使用Visual C ++停止在发布模式下工作

[英]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.

相关问题 我可以通过boost :: interprocess :: message_queue发送C ++类对象吗? - Can I send a C++ class object via boost::interprocess::message_queue? boost interprocess message_queue和fork - boost interprocess message_queue and fork boost :: interprocess :: message_queue权限被拒绝 - boost::interprocess::message_queue permission denied boost::interprocess::message_queue 在第二个进程中没有收到消息 - boost::interprocess::message_queue no message received in second process boost :: interprocess message_queue-Windows 7低完整性进程 - boost::interprocess message_queue - Windows 7 low integrity process 使用boost :: interprocess :: message_queue多个应用程序安全吗? - Is it safe to consume a boost::interprocess::message_queue multiple applications? 错误:“ size_type”不是“ boost :: interprocess :: message_queue”的成员 - error: ‘size_type’ is not a member of ‘boost::interprocess::message_queue’ boost::interprocess message_queue 性能 - 相当慢? - boost::interprocess message_queue performance - rather slow? Boost进程间message_queue具有非常量get_num_msg()。 为什么? - Boost interprocess message_queue has non const get_num_msg(). Why? 如何知道boost :: interprocess :: message_queue已从系统中删除? - How to get know that boost::interprocess::message_queue was removed from system?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM