Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.


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:

  1. Draw a Gantt chart showing the execution of three processes using the Shortest Remaining Time First (SRTF) scheduling.
  2. Find the turnaround time of each process for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart.
  3. Calculate the waiting time for the three processes for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart?

Process P1 P2 P3 Arrival Time 0.0 1.0 3.0 Burst Time 3 8 00 6

Step by Step Solution

3.43 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

The detailed ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Government and Not for Profit Accounting Concepts and Practices

Authors: Michael H. Granof, Saleha B. Khumawala

6th edition

978-1-119-4958, 9781118473047, 1118155971, 1118473043, 978-1118155974

More Books

Students also viewed these Programming questions