June 2017
Beginner to intermediate
274 pages
6h 49m
English
The multiprocessing module contains a class called Process that represents the ability to run code in a separate process.
Probably the simplest way to use the Process class is to subclass it and override the run method, which is the entry point for code in the other process, as shown in this code example:

In the preceding example, we created a specific kind of process that calculates some square numbers. Then, we created an instance and started running it. When we called start, the multiprocessing module did the necessary work to make sure that the run method was executed in a new process.
Read now
Unlock full access