问题描述
io_service对象:: poll_one运行io_service对象的事件处理循环
执行一个准备处理程序。
VS
io_service对象:: run_one运行io_service对象的事件处理循环
至多一个处理程序来执行。
从该解释这似乎poll_one可以执行多个处理程序?是否run_one或poll_one使用)调用poll_one / run_one这就是所谓的run(任何线程或只是线程?
From that explanation it would seem poll_one could execute more than one handler? Does run_one or poll_one use any thread that's called run() or only the thread that calls poll_one/run_one?
有关ASIO的文档是很稀疏。
The documentation for ASIO is very sparse.
推荐答案
poll_one
将情况立即(非阻塞)返回没有事件来处理。
poll_one
will return immediately (non-blocking) in case there is no event to process.
run_one
将阻塞调用线程,直到一个事件准备处理。
run_one
will block the calling thread until one event is ready to process.
You could also check some documentation here
这篇关于什么是升压io_service对象poll_one和run_one之间::区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!