Async Techniques and Examples in Python Transcripts
Chapter: Leveraging CPU cores with multiprocessing
Lecture: Python async landscape: multiprocessing
0:00 So far we been primarily focused on using parallelism
0:03 and while we're waiting on external services or
0:06 doing other things like that.
0:08 We're not trying to take advantage of the processors
0:10 that have all these cores.
0:11 We're just trying to make our computers do more
0:14 typically talking to external systems.
0:16 And that's great, that's a really, really common
0:18 probably the most common reason people use parallelism.
0:21 But with these modern CPUs, you probably do want to take
0:25 full advantage of their computational power.
0:27 So that's what we're going to focus on in this chapter.
0:30 That means we've jumped our divider line.
0:32 We're no longer in the do more at once section.
0:34 We're now trying to do things faster.
0:36 As in, run a particular algorithm faster
0:39 on a given piece of hardware
0:40 especially multicore, multiCPU type of machines.
0:45 So we're going to focus on multiprocessing
0:47 a particular module which saw just a little bit of a cameo
0:50 in the previous chapter. Multiprocessing is very similar
0:54 to the threading programming model
0:55 except we'll see that with multiprocessing
0:58 each operation runs in an entirely separate Python process.