Write a C program that launches and manages 3 parallel processes (tip: use fork(
ID: 655236 • Letter: W
Question
Write a C program that launches and manages 3 parallel processes (tip: use fork()), each to monitor one metric from your Unix machine. Namely:
(a) the most intense running process by CPU usage;
(b) the most intense running process by memory usage; and
(c) the longest running process by time.
Each child process should report to a centralized log file (maintained by the main program) at a 20 second interval. Each log record should contain the metric being observed, the name of the process, its PID and user. Terminate the program if the log file reaches 5kbytes. Note that, since all 3 processes are writing to the same log file, you must avoid racing conditions that may occur if 2 processes try to write to the log file at the same time.
Explanation / Answer
worst answer i have seen
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.