Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 1 Process Communication Problem 1 Problem: Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will

Project 1

Process Communication

Problem 1

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 ( ).

Exp:

100

20

35

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 parents process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format:

Hi Im process 2 and my parent is 1.

Hi Im process 3 and my parent is 2.

Hi Im process 4 and my parent is 2.

Max=50

Min=1

Sum=371

Part A: Write a program to answer this problem using only one process.

Part B: Write a program to answer this problem using multiple processes where each process spawns at most one process. (Like DFS)

Part C: Write a program to answer this problem using multiple processes where the first process spawns all other processes. (Like BFS)

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)

Extra Credit: Record the time it takes for each of the programs to run and comment on your observations. Try it on lists of size 10,100,1k,10k,100k.

Hint: You should first load the file into an array then start working on the data.

What to turn in:

C files for each problem

A makefile in order to run your programs.

Input text file (your test case)

Output text file (for your test case)

Report: Explain design decisions (fewer vs. more processes, process structure, etc.). Give one thing you have learned. Include the extra credit observation in this report.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

1 The difference between a command system and a market system.

Answered: 1 week ago

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago