Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Operating System (CS604)

Assignment # 02
Spring 2021


Total marks 20                                                                              


Deadline Date



Please carefully read the following instructions before attempting the assignment.



It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or the file is corrupt.
  • Strict action will be taken if the submitted solution is copied from any other student or the internet.


You should consult the recommended books to clarify your concepts as handouts are not sufficient.

Assignment Submission:

You are supposed to submit your assignment in .doc or Docx format.

Any other formats like scan images, PDF, zip, rar, ppt, and BMP, etc will not be accepted.

You are required to send question no. 1 as a screenshot displaying the compilation and running of both required programs. Furthermore C code of question no. 1 for both Programs should also be pasted in the same word file after the screenshot. Question No. 2 answer should also be pasted in the same word file



The objective of this assignment is to provide hands-on experience of:

  • To learn and understand inter-process communication using FIFOs.
  • SRTF scheduling algorithm


Note: Lectures No. 8 to 15 are covered in this assignment.




No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is recommended to upload the solution file at least two days before its closing date.


If you find any mistake or confusion in the assignment (Question statement), please consult with your instructor before the deadline. After the deadline, no queries will be entertained in this regard.


For any query, feel free to email at:






Question No. 1                                                                                                                         15 Marks      

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. program1 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 program2 in fifo_one. After reading your name and VUID, program1 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 program1 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.

C code of question no. 1 for both programs should also be pasted in the same word file after the screenshot.  Question No. 2 answer should also be pasted in the same word file.

Question No. 2                                                                                                                         05 Marks      

Consider the following three processes, with the Arrival time and CPU burst time, is given in milliseconds:



Arrival Time

 Burst Time











  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?


Note: in case you have installed the Virtual Box you can take the screenshot as follows. Go to the view menu and click on Take Screenshot as follow.


See the following link for writing and compiling your first program in Linux.

See the following link for downloading and installing VirtualBox and Ubuntu.

See also the following tutorial links at VULMS for downloading and installing VirtualBox.

Also see the following tutorial at VULMS, and follow the instructions for Installing Ubuntu in VirtualBox


You can work in Linux through chrome web Store, or click at the following link and press the start button Ubuntu will be started.


The End


Views: 868

Replies to This Discussion

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS604 Assignment#02 Solution 


CS604 Assignment no2 solution | Cs604 assignment Solution | cs604 latest Assignment no2 Solution

CS604 Assignment 2 Solution Spring 2021 || Operating System || 100% Correct Solution


Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP


Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service