Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Multi-process Word Counting Program (50%) The main problem of a single-process program is the scalability. It cannot scale large number of words. To address the

image text in transcribed

Multi-process Word Counting Program (50%) The main problem of a single-process program is the scalability. It cannot scale large number of words. To address the problem, you will convert the word counting program into the multi- process model. The main process creates multiple child processes and effectively divides work between child processes. The child process sends the result to the main process via Inter-process communication channel. We will use pipe in this project. The main process waits children processes and reads the result via IPC channel, and prints out the total on the screen. You will modify "wce to a multi-process model. The program receives the number of child processes and an input file name through the command-line argument. o 1 argument target file - 2nd argument # of child processes (default is 0) 3rd argument crash rate (default is 0%) Example:./wc./large.Dxt 4 Explain your program structure and IPC in README.pdf file. Only "pdf" format will be accepted. It is slightly modified from the code in http://www.opentechguides.com/how- to/article/6/72/c-file-counts.html Crash-handling (50%) If one or more child processes crash before they complete the job (before sending the result through pipe), the final output will be incorrect. In this project, we will monitor the exit status of each child. If there is one or more child processes crashed, we will create new child processes to complete the job. The parent process should wait for all child processes and monitor their exit status (hint: use waitpid). If an exit status of a child process is abnormal termination by a signal, the parent process creates a new child process to re-do the incomplete job. You can use 3rd command-line arguments integer between 1 and 50) to trigger crash. 50 means each child process has 50% chance to be killed abnormally by signal. O means 0% chance to crash. Explain how your program handles crash in README pdf file. Submission Submit a tarball file using the following command % tar czvfp1.tar.gz README.pdf Makefile we_multi. 1. README.pdf file with: a. Your name b. Explain your design of multi-process structure and IPC c Explain how your program handles crash. 2. Your code should be compiled in odin machine. 3. Submit a tarball through ELC. Multi-process Word Counting Program (50%) The main problem of a single-process program is the scalability. It cannot scale large number of words. To address the problem, you will convert the word counting program into the multi- process model. The main process creates multiple child processes and effectively divides work between child processes. The child process sends the result to the main process via Inter-process communication channel. We will use pipe in this project. The main process waits children processes and reads the result via IPC channel, and prints out the total on the screen. You will modify "wce to a multi-process model. The program receives the number of child processes and an input file name through the command-line argument. o 1 argument target file - 2nd argument # of child processes (default is 0) 3rd argument crash rate (default is 0%) Example:./wc./large.Dxt 4 Explain your program structure and IPC in README.pdf file. Only "pdf" format will be accepted. It is slightly modified from the code in http://www.opentechguides.com/how- to/article/6/72/c-file-counts.html Crash-handling (50%) If one or more child processes crash before they complete the job (before sending the result through pipe), the final output will be incorrect. In this project, we will monitor the exit status of each child. If there is one or more child processes crashed, we will create new child processes to complete the job. The parent process should wait for all child processes and monitor their exit status (hint: use waitpid). If an exit status of a child process is abnormal termination by a signal, the parent process creates a new child process to re-do the incomplete job. You can use 3rd command-line arguments integer between 1 and 50) to trigger crash. 50 means each child process has 50% chance to be killed abnormally by signal. O means 0% chance to crash. Explain how your program handles crash in README pdf file. Submission Submit a tarball file using the following command % tar czvfp1.tar.gz README.pdf Makefile we_multi. 1. README.pdf file with: a. Your name b. Explain your design of multi-process structure and IPC c Explain how your program handles crash. 2. Your code should be compiled in odin machine. 3. Submit a tarball through ELC

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

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago