Question: Part D: Write a program to answer this problem using multiple processes where the first process spawns multiple processes and they spawn their own multiple
Part D: Write a program to answer this problem using multiple processes where the first process spawns multiple processes and they spawn their own multiple processes. Your ultimate goal should be to produce such a hierarchy of processes so that performance compared to parts B and C, is optimized. (So basically this should be a combination of structures of Part B + Part C)
where Part B was: Write a program to answer this problem using multiple processes where each process spawns at most one process. (Like DFS) and Part C was: Write a program to answer this problem using multiple processes where the first process spawns all other processes. (Like BFS)
Problem: Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will be in a text file you generate. You may use any form of interprocess communication (IPC) to partition the file/array into chunks and distribute work to more than one processes (if there are multiple ones) (e.g., pipes, shared memory, or additional (perhaps more sophisticated) inherent process system calls). Input Format: Input will be in a text file. Each integer will be separated by a newline character (n). 100 output Format: You should print out the results in a text file. Every process that is created should print out their own process id and their parent's process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format: Hi I'm process 2 and my parent is 1. Hi I'm process 3 and my parent is 2. Hi I'm process 4 and my parent is 2. Max 50 Min Sum 37 Problem: Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will be in a text file you generate. You may use any form of interprocess communication (IPC) to partition the file/array into chunks and distribute work to more than one processes (if there are multiple ones) (e.g., pipes, shared memory, or additional (perhaps more sophisticated) inherent process system calls). Input Format: Input will be in a text file. Each integer will be separated by a newline character (n). 100 output Format: You should print out the results in a text file. Every process that is created should print out their own process id and their parent's process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format: Hi I'm process 2 and my parent is 1. Hi I'm process 3 and my parent is 2. Hi I'm process 4 and my parent is 2. Max 50 Min Sum 37
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
