Loading tutorials
move keyword, with Result, Option, and unwrap, and with basic traits and generics. You need cargo to build and run the examples.3 min readResult and unwrap, and how to build programs with cargo. It covers how to start a thread and how to wait for its result. Moving data into threads comes in the next chapter.2 min readResult and unwrap. It also assumes you can run programs with cargo. It covers why thread::spawn almost always needs move, and what that does to your variables.2 min readthread::spawn with move closures from earlier chapters. It explains the two marker traits the compiler checks whenever data crosses a thread boundary.2 min readmove closures, and that you can spawn and join threads. It also assumes you are comfortable with Result and unwrap. Here you will send values from one thread to another.2 min readmove closures, and send values through a basic mpsc channel. It shows how several threads send into one channel and how to make the receiving loop end.2 min readmove closures, and create an mpsc channel with Sender and Receiver. You should also be comfortable with Result and match. Here you will pick the right way to read from a Receiver.2 min readmpsc::channel, and read Result values. A channel has no close() method. It closes when one end is dropped, and the other end finds out through an error.2 min readmpsc channels work, and how a channel closes when its senders or receiver are dropped. It also assumes you are comfortable with Result and unwrap. Here you will see how failures in threads and channels show up as Result values,3 min readmove, thread::spawn and join, and Result with unwrap. Scoped threads solve one specific problem: letting a thread borrow local data without Arc or cloning.3 min readmpsc::channel with Sender and Receiver. It also assumes you know how a channel closes when all senders are dropped.3 min readmove, Result and unwrap, and the basics of thread::spawn. It also assumes you have seen Send and Sync and know that channels pass values between threads. Channels move data from one thread to another. Sometimes several 3 min readthread::spawn and join, move closures, mpsc channels, and Arc<Mutex<T>>. It combines them into a worker pool: a fixed set of threads that pull jobs from one queue.2 min readmove closures, send values through mpsc channels, and share data with Arc<Mutex<T>>. It helps you pick one approach for a given problem.3 min read