-
Book Overview & Buying
-
Table Of Contents
Python Parallel Programming Cookbook
By :
The multiprocessing library provides the Pool class for simple parallel processing tasks. The Pool class has the following methods:
apply(): It blocks until the result is ready.
apply_async(): This is a variant of the apply() method, which returns a result object. It is an asynchronous operation that will not lock the main thread until all the child classes are executed.
map(): This is the parallel equivalent of the map() built-in function. It blocks until the result is ready, this method chops the iterable data in a number of chunks that submits to the process pool as separate tasks.
map_async(): This is a variant of the map() method, which returns a result object. If a callback is specified, then it should be callable, which accepts a single argument. When the result becomes ready, a callback is applied to it (unless the call failed). A callback should be completed immediately; otherwise, the thread that handles the results will get blocked.
This example...
Change the font size
Change margin width
Change background colour