Concurrency
Threads, channels, Arc, Mutex, and atomics.
8 examples
BasicsOwnershipCompound TypesFlow ControlFunctionsGenericsTraitsError HandlingCollectionsConcurrencyAsyncSmart PointersIteratorsPatternsModulesMacrosUnsafeLifetimesTestingFile I/OSerializationCLI
intermediate3 examples
advanced5 examples
Arc and Mutex
Share state between threads safely with Arc<Mutex<T>>.
Atomic Types
Use atomic types for lock-free concurrent programming.
Barrier Synchronization
Synchronize multiple threads with Barrier.
RwLock
Read-write lock for concurrent reads and exclusive writes.
Thread Pool Pattern
Simple thread pool pattern with channels.