Develop a program to do the follows. (40pts) a) Create a pipe. b) Fork() a child process. c) Let the parent process writ
Posted: Fri May 20, 2022 3:00 pm
Develop a program to do the follows. (40pts) a) Create a pipe.
b) Fork() a child process. c) Let the parent process write 20
integers between [1, 50] to the pipe. Use random() function to
generate the integers. d) Let the child process read the 20
integers from the pipe and write them to a message queue.
Let the child process create the message queue, and then do the
writing. Assign type 1 to odd integer, and assign type 2 to even
integer when writing them to the message queue.
b) Fork() a child process. c) Let the parent process write 20
integers between [1, 50] to the pipe. Use random() function to
generate the integers. d) Let the child process read the 20
integers from the pipe and write them to a message queue.
Let the child process create the message queue, and then do the
writing. Assign type 1 to odd integer, and assign type 2 to even
integer when writing them to the message queue.