Threads in Rust
- Threads in Rust
- Available cores
- Simple thread (with fake work)
- Simple thread
- Simple thread with join
- Show that threads work in parallel
- Return value from thread
- Handle panic! in threads
- Threads polling the substhreads
- Threads with messages
- Two threads sending messages
- Testing speed improvements with threads
- Save many files (both CPU and IO intensive)
- Rust threads read-only access to shared variables
- Shared read-only variable with numeric value
- Shared read-only variable with string value
- Shared read-only variable with string value with Arc
- Pass reference of read-only vector to thread
- Pass reference of read-only vector to thread improved
- Process read-only string slices in parallel
- Filling the memory showing that Arc works
- Pass and return ownership
- Thread scope
- chdir in threads
- Environment variables in threads
- Counter in a loop in the same process and thread
- Mutex - without threads
- Lock with Mutex
- Counter with threads (shared variable) using Mutex
- Counter with threads (local counting)
- Counter with message passing
- thread-local variables
- Exercise: character counting
- Exercise: word count
- Exercise: count characters, words
- Exercise: run several functions on the same text
- Exercise: Download many files in threads
- Solution: count characters, words
- Solution: run several functions on the same text