You discuss the elements of the example program in a different order here. You should say so and even insist on this point, because order matters with multiprocessing in a way that's not at all obvious to a beginner. For example, you must first define function you plan to call in parallel, *then* check for __main__, and *then* create the pool of worker processes.