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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started