6. (20 points) Using Unix pipe() and C (or C++), write code to implement the fol
ID: 3596985 • Letter: 6
Question
6. (20 points) Using Unix pipe() and C (or C++), write code to implement the following system: The main process A creates a new process B; either A or B creates a third process C; then A, B or C creates a fourth process D. A reads a value X from stdin, adds 2 to X, sends X to C via a pipe. C adds 4 to X and sends it to D via a second pipe. B generates a random number Y and sends it D via a third pipe. D computes the product of X and Y (that is, x * Y), and prints out to sdout this sum. Write ([S)[.at, s'>tom);e.Explanation / Answer
Thank you.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.