知识卡片
预热惰性队列
初始化状态直接影响调度能力,某组没有任务时按需启动可能节省资源,也可能让它无法帮助其他队列。建立显式启动边界,验证线程数及失败处理,能让调用者依赖运行时已准备就绪。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 初始化与配置时序
原书出处 · 1 处
- Chapter 3. Building Our Own Async Queues 初始化与配置时序 · 查看原书依据
You may remember that the queue is lazy: it will not start until it is called. This directly affects our task stealing. The example we gave was that if no tasks were sent to the high-priority queue, that queue would not start and therefore would not steal tasks from the low-priority queue if empty, and vice versa. Configuring a runtime to get things going and
参考来源
- 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第03章《Chapter 3. Building Our Own Async Queues》,初始化与配置时序(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch03.html#id21)
- 结论依据:惰性队列只有首次访问才启动消费者,原书分别提交空任务来准备两边。
- 原始内容:You may remember that the queue is lazy: it will not start until it is called. This directly affects our task stealing. The example we gave was that if no tasks were sent to the high-priority queue, that queue would not start and therefore would not steal tasks from the low-priority queue if empty, and vice versa. Configuring a runtime to get things going and