知识卡片

普通读书笔记卡 · 10875 · 生成模型:未记录

异步让出等待时间

理解等级:中级

网络服务中的处理逻辑经常等待 I/O,异步任务可在等待期间暂停,让执行线程处理其他就绪任务。Actix 示例用异步入口和 .await 驱动服务,避免按连接占用一个线程。密集计算仍需考虑可用处理器和工作切分。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Programming Rust Fast, Safe Systems Development, 3rd ed. (First Early Release)》第01章《A Tour of Rust》|用类型连接表单、处理器和响应,来源项目 `book-source`,`extracted/Programming Rust Fast, Safe Systems Development, 3rd ed. (First Early Release)/_epub-src/OEBPS/ch01.xhtml#serving-pages-to-the-web` - 结论依据:原文解释网络等待与一个核心上并行调度多个异步任务的关系。 - 原始内容:They’re a way to deal with tasks that don’t need the CPU all the time—perhaps because, as in our case, they will spend