Implement the parallel utility that has 3 command line arguments. This will execute 4 copies of the sleep process for 10 seconds. Your program should allow an arbitrary number of command line arguments for the process to be run in parallel. The parent process should wait for all child processes to finish before exiting back to the shell. If the format of the command is not recognized (e.g. the first argument is not an integer), an error can be displayed. All your code should be contained in the parallel.c file, and the Makefile. ./parallel For example, if you type: ./parallel 4 sleep 10 OUTPUT: SUCCESS in running 4 parallel sleep tasks
Parallel:-
Implement the parallel utility that has 3 command line arguments. This will execute 4 copies of the sleep process for 10 seconds. Your program should allow an arbitrary number of command line arguments for the process to be run in parallel. The parent process should wait for all child processes to finish before exiting back to the shell. If the format of the command is not recognized (e.g. the first argument is not an integer), an error can be displayed. All your code should be contained in the parallel.c file, and the Makefile.
./parallel<processes><cmd><args>
For example, if you type:
./parallel 4 sleep 10
OUTPUT: SUCCESS in running 4 parallel sleep tasks
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images