Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please provide the proper code for below requiremnts Write and run a C program on UNIX that creates four new processes: A , B ,
please provide the proper code for below requiremnts
Write and run a C program on UNIX that creates four new processes: A B C
and D When the original process creates the new processes, it passes them
all the same pipe that they can use to send data to the original process,
which will serve as a logging process, displaying each line it receives along
with a time stamp. A pipeline is to exist between A and B another between
B and C and another between B and D Including the shared pipe back to the
logging process and these three pipes AB BC BD there are four pipes.
Process A generates records consisting of the letter C or D picked at
random for each record along with the record number byte ASCII issued
sequentially from to and sends it to process B Process A also sends a
log message something like: A sent process B D to the logging process.
Process B reads from the pipe connecting it to A For each record it reads,
it will send it to the process indicated by the first character, along with
sending an appropriate log message to the logging process. For example, if
it receives a message containing C it sends the message to process C
After sending the logging message, process B waits one second.
Process C reads its pipe and for each message received it sends the logging
process an appropriate message.
Process D reads its pipe and for each message received it sends the logging
process an appropriate message. Process D then waits seconds after every
time it receives a message.
The logging process should terminate when it receives messages, which is
messages from A to B a total of messages from either B to C or B to D
and then a total of more messages from either C or D indicating receipt.
Implement some way to terminate the other processes at appropriate times.
Put all your code into a single source file. Turn in a listing of that file
along with a script recording the execution of your program.
Discuss the order of events shown in the log display.
Is there any clear evidence of independent processes being executed?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started