1 00:00:06,544 --> 00:00:09,510 - Hello again, and welcome to lesson 14. 2 00:00:09,510 --> 00:00:13,020 This lesson is all about multithreading and concurrency. 3 00:00:13,020 --> 00:00:15,810 We begin by showing how to spawn a thread. 4 00:00:15,810 --> 00:00:17,430 In other words, how to create it. 5 00:00:17,430 --> 00:00:19,620 Then we'll see how to join the thread or multiple threads, 6 00:00:19,620 --> 00:00:21,930 in other words, to wait for 'em to finish. 7 00:00:21,930 --> 00:00:24,090 After that, we'll see how a thread 8 00:00:24,090 --> 00:00:27,570 can capture a state for its external context. 9 00:00:27,570 --> 00:00:29,940 We've discussed the concepts and the syntax, 10 00:00:29,940 --> 00:00:31,650 and we'll see why it's essential 11 00:00:31,650 --> 00:00:33,960 that the thread always captures external state 12 00:00:33,960 --> 00:00:35,550 by moving it into the thread, 13 00:00:35,550 --> 00:00:38,013 rather than just borrowing it via a reference. 14 00:00:38,910 --> 00:00:39,990 At the end of the lesson, 15 00:00:39,990 --> 00:00:42,630 we'll discuss the concept of channels. 16 00:00:42,630 --> 00:00:45,240 A channel is a communication pipeline 17 00:00:45,240 --> 00:00:48,720 that conveys data safely from one thread to another. 18 00:00:48,720 --> 00:00:51,300 This is the preferred way to communicate 19 00:00:51,300 --> 00:00:52,623 between threads in Rust.