From the course: C# Essential Training 2: Generics, Collections, and LINQ

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Threading basics

Threading basics

- [Instructor] Next, I want to take a look at threading. Now, we're not going to get too deep into threading, it's a fairly advanced concept, but I do want to talk about some basic language constructs that make working with multi-threaded applications or APIs a lot simpler. If we start by looking at some basics around threading. And you may be familiar with this if you've used multi-threaded programming in other languages. The idea is that when we run an application, we have this main application thread and that's going to sequentially execute the commands in our program. But sometimes we need to do something like access a file, and that can be a long operation. If it's a large file and we need to read it or write to it, then we may want to do that on another thread. And what that allows us to do is move that into a separate area of execution where that doesn't block the application itself. Now, this is really useful…

Contents