å¹¾æ¥ã®åã«ãç§ã¯boost::asioãéãã§ããããããã³ã¼ããæ¸ãã #include #include #include #include using std::cout; using std::endl; using namespace boost; using namespace boost::asio; io_service ioserv; mutex m; volatile int c = 0; void add() { lock_guard g(m); ++c; } int main() { thread t1(bind(&io_service::run, ref(ioserv))); thread t2(bind(&io_service::run, ref(ioserv))); for(int i = 0; i < 655360; ++i) ioserv.post(&ad
{{#tags}}- {{label}}
{{/tags}}