Question: 1. Develop a small program where a task is split into subtasks and executed by child worker processes. The results of the task must be
1. Develop a small program where a task is split into subtasks and executed by child worker processes. The results of the task must be collected in the main process which will wait for all tasks to complete and all results to be gathered before reporting a final result. If you are stuck for ideas, generate a random number and block in each task, gather the random numbers in the main process and sum their values.
2. Implement the program in a few different ways to explore the different approaches to sharing data between processes. Few of them for this task are, try using a pipe, try using a queue, and also try using an Array. Sharing data between processes is central to almost all programs that achieve parallelism via the multiprocessing module.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
