From the course: Visual Studio: Advanced Debugging Tools

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

See worker threads in the Threads window

See worker threads in the Threads window - Visual Studio Tutorial

From the course: Visual Studio: Advanced Debugging Tools

Start my 1-month free trial

See worker threads in the Threads window

- [Narrator] I have three choices for looking at multiple threads. Use parallel, use tasks, and use async/await. All three of them will show multiple threads, but I think the one that's best for this video, and the rest of the chapter, is number three, or C: Use Tasks. And the reason why is it lets us see when the new thread is spawned. I'll press C, and we'll start by looking at the threads window at the top. It looks the same as the last example. I'm on the main thread, ID one, I'm going to run the code in this ChargeBatteries by pressing F10. And when I finish, I'm still on Managed Thread One, main thread. At this point, when I press F10, what's going to happen? I'm asking the task class to create a new task, and start it. So, I'm not actually creating a thread. I'm creating a task, and asking the task to run this code in FindGemstones, and on my behalf, it will create another…

Contents