- Welcome to Ultimate Rust: Foundations - Fearless Concurrency with System Threads.
- This is part 2 of 5 sessions you can take individually or together.
- Each day will be divided into four hours, with a 10-12 minute break at the end of each hour.
- Please let me know in the chat what languages you're used to working with, and your experience level with Rust.
- If I go too fast, please say something.
- If you have questions, please either drop them in the chat or let me know.
- We'll create a Git repo on Github for the class, and commit to it as we go. That way, you have everything we create together. You also have this outline.
- The video for this class should be available in about a week, you should have received an email telling you how to access it.
Herbert has been developing software professionally for more than 20 years. Starting with BASIC, Pascal, and then moving onto C and C++, Herbert has developed custom applications ranging from web-server filters to games. Herbert is the author of Hands-on Rust and Rust Brain Teasers.
| Book | Publisher E-Book | Amazon | |
|---|---|---|---|
| Hands-on Rust | ![]() |
PragProg Page | Amazon Page |
| Rust Brain Teasers | ![]() |
PragProg Page | Amazon Page |
I recommend bookmarking the following resources:
The outline for this class is available: https://github.com/thebracket/ArdanUltimateRustFoundations/
Today, we're going to build on last week's introduction to Rust and focus on a deep-dive into Rust's threading features. Rust makes threading easy---relative to other languages. Rust protects you from data races, and guards against data corruption. It makes it easy to create threads, communicate between them and safely share data. There's a lot of potential pitfalls---even fearless concurrency can be hard. Rust makes it easier.
- What is a System Thread? (And how does it differ from
async/await?) - Create your first thread
- Threads with parameters and closures.
- Returning data from threads.
- Dividing workloads for fast execution.
- Controlling thread parameters.
- Scoped Threads for easy local data sharing.
- Sharing Data:
- with Atomics.
- with Mutexes.
- with Read/Write locks.
- with lock-free structures.
- Deadlocks, Poisoning and Panic Attacks.
- Parking Threads.
- Sending Data with Channels.
- Channels and Ownership.
- Sending Functions to Worker Threads.
- Build a Sime Work Queue
- CPU Affinity.
- Thread Priority.
- Making it easy with
Rayon
We'll end with a QA, some pointers to crates that can help you, and pointers towards next week.

