June 2019
Beginner to intermediate
770 pages
19h 24m
English
Objects are transferred among processes through queues or pipes. Building queues involves creating instances of multiprocessing.Queue or one of its subclasses. For this example, we can use the following:
setup_q = multiprocessing.SimpleQueue() results_q = multiprocessing.SimpleQueue()
We created two queues that define the processing pipeline. When we put a simulation request into setup_q, we expect that a Simulation process will get the request pair and run the simulation. This should generate a results triple, which is put in results_q. The results triple should, in turn, lead the work being done by the Summarize process. Here's how we can start a single Summarize process:
result = Summarize(results_q) ...
Read now
Unlock full access