<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>第二部分：参考 on 编程那些事儿</title><link>https://before80.github.io/prgms/Rust/asyncBook/part-reference/</link><description>Recent content in 第二部分：参考 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sun, 23 Aug 2026 21:05:58 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Rust/asyncBook/part-reference/index.xml" rel="self" type="application/rss+xml"/><item><title>16-取消与取消安全性</title><link>https://before80.github.io/prgms/Rust/asyncBook/part-reference/16-cancellation-and-cancellation-safety/</link><pubDate>Sat, 22 Aug 2026 19:00:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/asyncBook/part-reference/16-cancellation-and-cancellation-safety/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://rust-lang.github.io/async-book/"&gt;Asynchronous Programming in Rust&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cancellation-and-cancellation-safety"&gt;取消与取消安全性&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://rust-lang.github.io/async-book/part-reference/cancellation.html"&gt;https://rust-lang.github.io/async-book/part-reference/cancellation.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;内部取消 vs 外部取消
线程 vs future
drop = 取消
仅在 await 点
有用特性
仍然有些突兀且令人意外
其他取消机制
abort
cancellation token（取消令牌）&lt;/p&gt;
&lt;h2 id="取消安全性"&gt;取消安全性&lt;/h2&gt;
&lt;p&gt;不是内存安全问题或竞态条件
数据丢失或其他逻辑错误
不同定义/名称
tokio 的定义
一般定义/停机安全性（halt safety）
应用复制 future 的思想
简单的数据丢失
恢复（resumption）
在循环中使用 select 或类似机制时的问题
将状态拆分到 future 与 context 之间作为根本原因&lt;/p&gt;</description></item><item><title>17-Pin</title><link>https://before80.github.io/prgms/Rust/asyncBook/part-reference/17-pinning/</link><pubDate>Sat, 22 Aug 2026 19:00:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/asyncBook/part-reference/17-pinning/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://rust-lang.github.io/async-book/"&gt;Asynchronous Programming in Rust&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="pinning"&gt;Pin&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://rust-lang.github.io/async-book/part-reference/pinning.html"&gt;https://rust-lang.github.io/async-book/part-reference/pinning.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Pin 是一个出了名的难以掌握的概念，具有一些微妙且令人困惑的性质。本节将深入探讨该主题（可以说过于深入）。Pin 是 Rust 中 async 编程实现的关键&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;，但完全有可能在从未遇到 Pin 的情况下走得很远，当然更不必对其有深入理解。&lt;/p&gt;</description></item><item><title>18-结构化并发</title><link>https://before80.github.io/prgms/Rust/asyncBook/part-reference/18-structured-concurrency/</link><pubDate>Sat, 22 Aug 2026 19:00:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/asyncBook/part-reference/18-structured-concurrency/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://rust-lang.github.io/async-book/"&gt;Asynchronous Programming in Rust&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="structured-concurrency"&gt;结构化并发&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://rust-lang.github.io/async-book/part-reference/structured.html"&gt;https://rust-lang.github.io/async-book/part-reference/structured.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;作者注（TODO）：我们可能希望在本章之前更早讨论其中某些部分，尤其是作为设计原则（首次介绍在 guide/intro 中）。不过，为了更好地理解该主题并先写出一版内容，我从独立一章开始。内容也仍有些粗糙。&lt;/p&gt;</description></item></channel></rss>