Boost logo

Boost Users :

Subject: [Boost-users] Can I use std::queue as ASIO io object for asynchronise operation?
From: liubl (809651688_at_[hidden])
Date: 2012-03-24 23:23:17


Hi, I want to implement a message queue between multiple thread, with multiple thread post message to the queue and one single thread process the message. I don't want the single processing thread to be blocked by the os when there is no message to be processed. I don't know if I can use ASIO lib to help me implement it. In my thought, the single processing thread read the queue asynchronisely and be invoked if there is one message ready on the queue, just like there is data ready on the socket. Is it doable? And is its performance better than the blocking method using conditional_variable? Regards, -Bruce



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net