What is the difference between poll and run?

荒凉一梦 提交于 2019-12-23 12:43:12

问题


Does anyone have an example illustrating the difference between boost::asio::io_service::poll and boost::asio::io_service::run?

More specifically what is the difference between calling join_all() on a thread_group executing run() and on another one executing poll()? Do both guarantee that all events have finished?

In the documentation available at http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/reference/io_service/run/overload1.html, it is said:

The poll() function may also be used to dispatch ready handlers, but without blocking.

but I can't see what it clearly means.

来源:https://stackoverflow.com/questions/37392856/what-is-the-difference-between-poll-and-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!