From the course: Complete Guide to Parallel and Concurrent Programming in Python

Unlock the full course today

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

Multiple threads: Python demo

Multiple threads: Python demo

- [Instructor] We'll start with a demonstration using Python's threading module to create several concurrent threads and investigate their impact on this computer's CPU usage. But before diving into code, let's first take a look at the number of processors that are available on this computer, which I'll be using for demonstrations throughout this course. To do that, I'll press Ctrl + Shift + Esc to open the Task Manager, and then select the Performance tab. Down at the bottom, I can see that this computer has 12 cores and 24 logical processors. Those numbers mean this computer has 12 separate complete physical processing cores, and each of those cores supports something called hyperthreading, which enables them to each run two independent applications at the same time. So the computer treats those 12 physical cores as 24 logical processors. Now, the hyperthreading in those 12 cores does not mean I'll get double the performance out of them. Hyperthreading takes advantage of unused…

Contents