首页 > 其他 > 详细

libuv的三种运行模式(特别是UV_RUN_NOWAIT)

时间:2021-09-01 15:01:53      阅读:6      评论:0      收藏:0      [点我收藏+]

libuv的三种运行模式:

UV_RUN_DEFAULT: 默认轮询模式,此模式会一直运行事件循环直到没有活跃句柄、引用句柄、和请求句柄

UV_RUN_ONCE:一次轮询模式,处理一个事件。

UV_RUN_NOWAIT:一次轮询模式,最多处理一个事件。uv_run(loop, UV_RUN_NOWAIT) is similar to uv_run(loop, UV_RUN_ONCE) in that it will process only one event. UV_RUN_ONCE blocks if there are no pending events, while UV_RUN_NOWAIT will return immediately. We use NOWAIT so that one of the loops isn‘t starved because the other one has no pending activity.(UV_RUN_ONCE的意思是你想让我做件事儿,我就非要做一件,没有需要做的事儿的我就等着,也就是相信调用方告诉我有事儿就肯定会有)

libuv的三种运行模式(特别是UV_RUN_NOWAIT)

原文:https://www.cnblogs.com/dongzhiquan/p/15213174.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!