开发者

boost::interprocess::message_queue stops working in Release mode with visual C++

开发者 https://www.devze.com 2022-12-27 17:50 出处:网络
I am using boost::interprocess::message_queue, with VC++ (in Microsoft Visual Studio 2005). It is working properly in Debug mode.

I am using boost::interprocess::message_queue, with VC++ (in 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. I don't understand what could be the settings that ar开发者_开发技巧e different between Release and Debug mode, and that would make the queue stop working.


It turns out that my Release version does not do as much logging as the debug one. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消