Await-Tree Async Rust 可观测性的灵丹妙药 - 赵梓淇
第三届中国 Rust 开发者大会 Await-Tree Async Rust 可观测性的灵丹妙药 赵梓淇 Bugen Zhao Await-Tree Async Rust 可观测性的灵丹妙药 Await-Tree 的 设计原理与实现 2 回顾 Async Rust 的设计与痛点 1 Await-Tree 的 应用与真实案例 3 Await-Tree Async Rust 可观测性的灵丹妙药 设计原理与实现 2 回顾 Async Rust 的设计与痛点 1 Await-Tree 的 应用与真实案例 3 Async Rust 的优势 • 异步编程的共同优势 • async/await 关键字 • 用户态调度 • Async Rust 的独特优势 • Ownership 与 Lifetime • 无栈协程 Async Rust 回顾 Rust 的无栈协程抽象 — Future Future Async Rust 回顾 • 通过 poll 驱动的状态机 • 组合嵌套为调度单元: Task • async fn 语法糖 Async Rust 观测与调试的痛点 Async Rust 回顾 • 特性: Future 灵活的可组合性 • 任意定制 Poll 的执行逻辑 (Join / Select / Timeout) • 动态的调用关系 • 痛点:观测与调试工具无法理解灵活的执行逻辑0 码力 | 37 页 | 8.60 MB | 1 年前3How Meta Made Debugging Async Code Easier with Coroutines and Senders
… … Stack Traces for Async Code are Unhelpful Threadpool threads: #0 process_file(...) #5 pool.run() #10 __clone … … IO Thread: #0 async_read_some_at(...) #3 ctx Threadpool threads: #0 process_file(...) #5 pool.run() #10 … IO Thread: … #0 async_read_some_at(...) #3 ctx.run() #5 __clone … … Main thread: #0 unifex::sync_wait( … #0 async_read_some_at(...) … #12 unifex::sync_wait(...) #16 main() #19 __libc_start_main() … … Async Stacks are BetterStructured Concurrency Makes Async Stacks Possible0 码力 | 131 页 | 907.41 KB | 5 月前3Comprehensive Rust ?
Comprehensive Rust Martin Geisler Contents Welcome to Comprehensive Rust 11 1 Running the Course 13 1.1 Course Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.2 Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2 Using Cargo 18 2.1 The Rust Ecosystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2 Code Samples in This Welcome to Day 1 23 4 Hello, World 25 4.1 What is Rust? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.2 Benefits of Rust . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 378 页 | 1009.46 KB | 1 年前3Concurrency in Rust
in Rust Alex Crichton What’s Rust? Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. Concurrency? Libraries Futures Rust? What’s Deadlocks • Use after free • Double free Exploitable! Concurrency? Libraries Futures Rust? What’s Rust? Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees cout << elem; } elem vector ... [0] [0] [1] Dangling pointer! Aliased pointers Mutation Rust’s Solution Ownership/Borrowing No runtime Memory Safety No data races C++ GC Ownership fn0 码力 | 43 页 | 648.31 KB | 1 年前3Comprehensive Rust
Comprehensive Rust Martin Geisler 차 례 Comprehensive Rust 에 오신 것을 환영합니다 10 1 강의진행 12 1.1 강의구성 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.2 단축키 . . . . . . . . World! 23 4.1 러스트란? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2 Rust 의이점 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.3 플레이그라운드 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 IX 안드로이드 189 31 Welcome to Rust in Android 190 32 설치 191 33 빌드규칙 192 33.1 러스트바이너리 . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 368 页 | 1.29 MB | 1 年前32021-11-22 - Rust CTCFT - Rust for Linux
Rust for Linux Miguel Ojeda Wedson Almeida Filho Alex Gaynor Rust for Linux aims to add Rust support to the Linux kernel. We believe Rust offers key improvements over C in this domain. We hope improvement of Rust for everyone! Introduction Language Library Tooling Nightly features A general priority is to stabilize them (or to find alternatives): https://github.com/Rust-for-Linux/linux/issues/2 add w8, w10, w9 Language Memory model: future potential Unified/Compatible Linux kernel and Rust memory models: No need to use inline assembly to define a new memory model. Language-supported address0 码力 | 53 页 | 332.50 KB | 9 月前3RUST AS A CASE STUDY
BENEFITS AND DRAWBACKS OF ADOPTING A SECURE PROGRAMMING LANGUAGE: RUST AS A CASE STUDY Kelsey Fulton, Anna Chan, Daniel Votipka, Michelle Mazurek, Michael Hicks 1 Memory safety vulnerabilities https://www.zdnet.com/article/chrome-70- of-all-security-bugs-are-memory-safety-issues/ Case Study: Rust ■ Attempt safety and performance (e.g., no GC) ■ Useful where C/C++ are hardest to replace ■ language? 3 Case Study: Rust ■ Semi-structured interview with senior developers (I = 16) ■ Survey with Rust community (S = 178) 4 Learning Rust ■ Rust is hard to learn. 5 Rust has “a near-vertical0 码力 | 19 页 | 3.37 MB | 1 年前3Real world Rust - Why and how we use Rust in TiKV
Real world Rust Why and how we use Rust in TiKV 黄东旭 PingCAP 关于我 ● 黄东旭 Dongxu_Huang ● Open source hacker / Infrastructure Engineer ● MSRA / Netease / Wandoujia / PingCAP ● CTO of PingCAP ● Codis Go / Python / Rust ... What’s Rust ● Yet another system programming language ○ Maintain by Mozilla ● Stable: 1.13 ○ Stable enough for production use ● Alternative to C/C++ Why Rust? ● Safe ○ Thread ● Modern tool chain ○ Modern package management tools ○ Embedded unit test framework ● Stdlibs Rust 哲学 ● Zero-cost abstraction ● 内存安全 ○ Build-in RAII / Ownership ○ No NULL ptr ● 万物皆有所有权 ○ Ownership0 码力 | 29 页 | 506.53 KB | 1 年前3Comprehensive Rust(日语) 202412
Comprehensive Rust Martin Geisler 目次 Comprehensive Rust へようこそ 11 1 講座の運営について 13 1.1 講座の構成 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.2 キーボードショートカット . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2 Cargo の使用 18 2.1 Rust エコシステム . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2 講座のサンプルコード . . . Day 1:AM 22 3 Day 1 へようこそ 23 4 Hello, World 25 4.1 Rust とは? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.2 Rust のメリット . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 381 页 | 1.36 MB | 10 月前3Comprehensive Rust(English) 202412
Comprehensive Rust Martin Geisler Contents Welcome to Comprehensive Rust 11 1 Running the Course 13 1.1 Course Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.2 Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2 Using Cargo 19 2.1 The Rust Ecosystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2 Code Samples in This Welcome to Day 1 24 4 Hello, World 26 4.1 What is Rust? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.2 Benefits of Rust . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 382 页 | 1.00 MB | 10 月前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100