Aero T.

asked • 07/23/21

Write a C program where two child processes are created using fork().

Write a C program where two child processes are created using fork(). The parent process and the two child processes communicate with each other via a pipe. More specifically, the first child process writes 5 random number in the range of 0-99 to the pipe, and the second child process also writes another 5 random number in the same range to the pipe. The order of which child process writes to the pipe does not matter and the 10 random numbers could be interleaved between the two child processes. The parent process reads out the 10 random numbers from the pipe and print them out on the display (terminal).

Patrick B.

I'm interested, but only have cygwin unix emulator and Dev C++, and a shabby one at best, which do not support this type of IPC. The best I can offer is IPC via sockets using Java.
Report

07/23/21

Aero T.

Can you Please do it in C language
Report

07/23/21

Aero T.

Plaese
Report

07/23/21

Patrick B.

Per email all I have is Java. I left you with some source code in your other posting if you are interested. The server simply returns the string sent from the client. Those running Windows do not have access to Unix fork() calls for IPC. I got Dev C/C++ which doesn't have those Unix/Linux specific libraries. LIke I said in the email, I do not have access to mainframe Unix, but I have given to you what I CAN.
Report

07/24/21

1 Expert Answer

By:

Shanek K. answered • 08/13/21

Tutor
4.7 (74)

Computer Science Professional Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.