Loading tutorials
thread::spawn requires of its closure, why the compiler insists on move, and how data and results move between threads. By the end you will also see why moving data is not enough once sever5 min readmove, and the basics of thread::spawn and JoinHandle. It also assumes you are comfortable with Result, unwrap and pattern matching. It introduces no new synchronization types. Its job is to show what goes w5 min readmove, and thread::spawn with JoinHandle. You should also be comfortable with Result and unwrap. Here you will learn what Arc<T> is, how it behaves at runtime, and what it does not give you. It does not l6 min readmove, and the basics of thread::spawn and JoinHandle. It also assumes you are comfortable with Result and unwrap. By the end you should be able to read a "cannot be sent between threads safely" error and say which ty5 min readmove, thread::spawn with JoinHandle, and Result with unwrap. You don't need Arc yet. The next chapters combine it with Mutex. Here we study Mutex<T> by itself.5 min readDrop trait at a basic level, and how Arc<T> and Mutex<T> are introduced. It focuses on the value that Mutex::lock returns, which is how a lock gets released.5 min readArc and Mutex into the standard pattern for sharing mutable data between threads. It assumes you know Rust ownership, borrowing and lifetimes, closures and the move keyword, std::thread::spawn with JoinHandle, and basic Result and unwrap handling.6 min readArc<Mutex<T>> to share data between threads and know that lock() returns a guard that unlocks when it is dropped. It also assumes you know thread::spawn, move closures and unwrap. The chapter covers how long a thread should hold a lock, how to shorten that 5 min readArc<Mutex<T>>, lock guards and Drop, thread::spawn with JoinHandle::join, and Result, unwrap and closures. Here you will learn what poisoning is, why Rust does it, and how to handle it on purpose.5 min readArc<Mutex<T>>, know that a MutexGuard unlocks when it is dropped, and have read the chapter on keeping critical sections short. Here you will learn how a program that is correct in every other way can still freeze, and how to design against it.5 min readArc<Mutex<T>>, lock guards, and how thread::spawn with move closures works. It also assumes you can read Result and unwrap. Here you will learn when RwLock is a better fit than Mutex, how to use it, and where it goes wrong.5 min readArc, thread::spawn with move closures, and Mutex. It covers atomic types, which let threads share a single integer or boolean without a lock. It also covers when atomics are the wrong tool.5 min readthread::spawn, JoinHandle, move closures, and the basics of Arc<Mutex<T>> from the earlier chapters. It also assumes you can read Rust borrow checker errors.5 min readMutex protects data, but it can't tell a thread when that data has changed. This chapter covers Condvar, the standard library's tool for sleeping until another thread changes shared state. It assumes you know Arc<Mutex<T>>, lock guards, thread::spawn with move closures, and Result hand5 min readArc<Mutex<T>>, spawn threads with move closures, and read Result values. You have now seen shared state with Arc, Mutex, RwLock, atomics and Condvar. Rust's standard library also offers message passing through channels, and often it is the bette6 min read