From the course: Python Parallel and Concurrent Programming Part 1
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Multiple threads: Python demo - Python Tutorial
From the course: Python Parallel and Concurrent Programming Part 1
Multiple threads: Python demo
- [Man] 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 control, shift, escape 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 hyper-threading, 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 hyper-threading in those 12 cores, does not mean I'll get double the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Thread vs. process4m 35s
-
(Locked)
Concurrent vs. parallel execution4m 53s
-
Global interpreter lock: Python demo4m 35s
-
(Locked)
Multiple threads: Python demo6m
-
(Locked)
Multiple processes: Python demo5m 42s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: Python demo2m 42s
-
(Locked)
Thread lifecycle3m 35s
-
(Locked)
Thread lifecycle: Python demo5m 38s
-
(Locked)
Daemon thread2m 48s
-
(Locked)
Daemon thread: Python demo2m 29s
-
-
-
-
-