-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# 理解 async/await | ||
# 理解 async/await | ||
|
||
rustc 编译器遇到 async 函数时, 会在内部生成对应的状态机代码 (state machine), 这个状态机会实现 | ||
`Future` trait. | ||
|
||
## 参考 | ||
|
||
- [Understanding Async Await in Rust: From State Machines to Assembly Code](https://eventhelix.com/rust/rust-to-assembly-async-await/) | ||
- [Nested async/await in Rust: Desugaring and assembly](https://eventhelix.com/rust/rust-to-assembly-async-await-nested/) | ||
- [Rust async/await: Async executor](https://eventhelix.com/rust/rust-async-executor/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 如何调试 debug | ||
|
||
## 参考 | ||
|
||
- [tokie-console](https://github.com/tokio-rs/console) | ||
- [Writing a basic `async` debugger](https://cliffle.com/blog/lildb/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
# 理解 Futures 与 Tasks | ||
# 理解 Futures 与 Tasks | ||
|
||
在同步式的代码 (synchronous code) 里调用阻塞函数(blocking function), 会阻塞整个线程; | ||
而在异步式的代码里, `Future` 会把控制权返还给线程, 这样其它的 `Future` 就可以运行了. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 生命周期与内存保持 Lifetimes and Pinning |
This file was deleted.
Oops, something went wrong.