Write the two C programs named program1 and program2 that perform inter-process communication through FIFO. The functionality
Fantastic news! We've Found the answer you've been seeking!
Question:
Write the two C programs named program1 and program2 that perform inter-process communication through FIFO. The functionality of the two programs should be as follows.
- program1 should create a FIFO as fifo_one by using mknod() system call or through mkfifo() library call. program! should open
the fifo_one for reading purposes through open() system call. Then use the read() system call to read from fifo_one, your
name, and VUID that is written by program? in fifo_one. After reading your name and VUID, program! should display it on the
screen by write() system call. - program2 should open the fifo_one for writing purposes through open() system call. Then use the write() system call to write in
fifo_one your name and VUID. And finally, close and remove the fifo_one. - Use only read() and write() system call for reading and writing your name and VUID from FIFO and finally writing on the
terminal screen. As by default in FIFO both read() and write() system call do the blocking I/O. - As the two programs can't be run simultaneously in the foreground on the terminal window. So you need to run program! in the
background and subsequently program2 should be run in the foreground.
Following is the sample screenshot of both programs. You need to perform the following steps in the screenshot.
- In the screenshot firstly you should compile both C programs.
- Run the program1 in the background. finally,
- run the program2.
Consider the following three processes, with the Arrival time and CPU burst time, is given in milliseconds:
- Draw a Gantt chart showing the execution of three processes using the Shortest Remaining Time First (SRTF) scheduling.
- Find the turnaround time of each process for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart.
- Calculate the waiting time for the three processes for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart?
Related Book For
Government and Not for Profit Accounting Concepts and Practices
ISBN: 978-1118155974
6th edition
Authors: Michael H. Granof, Saleha B. Khumawala
Posted Date: