Somehow a followup of this question. I am only wondering if it is ok to use a std::mutex in functions handeled by a boost::asio:io_service? Usage o
std::mutex
boost::asio:io_service
Mutex inside completion handler can block thread execution. In that case you need more io_service threads than boost::thread::hardware_concurrency() to load CPU for 100%. It increases thread switching overhead.
io_service
boost::thread::hardware_concurrency()