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.

CS604 Operating Systems Assignment No 02 Fall 2020 Solution / Discussion

 

Operating System (CS604)

Assignment # 02
Fall 2020

Please carefully read the following instructions before attempting the assignment.

 

RULES FOR MARKING

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.

 

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.

 

OBJECTIVE

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

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

 

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

 

NOTE

 

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:

Cs604@vu.edu.pk

 

Question No. 1                                                                                                                         12 Marks      

Considering the two processes SP (Server Process) and CP Client Process, each creates two child process sc1, sc2, and cc1, cc2, respectively.  These processes create two FIFOs, FIFO 1 for reading and FIFO 2 for writing in SP and FIFO 1 for writing and FIFO2 for reading in CP to communicate with each other as shown in the figure.

Figure 1. Client-Server Communication

By considering the above scenario, you are required to write the output of the following code snippets.

 

  1. if ((mknod (FIFO1, S_IFIFO | PERMS, 0) < 0) && (errno != EEXIST))

 {

 perror ("mknod FIFO1");

 exit (1);

 }

  1. if (mkfifo(FIFO2, PERMS) < 0)

{

 unlink (FIFO1);

 perror("mknod FIFO2");

 exit (1);

  1. if ((readfd = open(FIFO1, 0)) < 0)

 {

 perror ("open FIFO1");

 exit (1);

  1. if ((writefd = open(FIFO2, 1)) < 0)

{

 perror ("open FIFO2");

 exit (1);

  1. size = strlen(MESSAGE1) + 1;

 if ((n = read(readfd, buff, size)) < 0) {

 perror ("server read"); exit (1);

 }

  1. size = strlen(MESSAGE1) + 1;

 if (write(writefd, MESSAGE1, size) != size)

{ perror ("client write1"); exit (1);

}

Question No. 2                                                                                                                         08 Marks      

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

Process

Arrival Time

 Burst Time

P1

0.0

10

P2

2.0

6

P3

3.0

2

Considering the time slice of 4 milliseconds.

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

Views: 1499

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

CS604 complete solution assignment no 02 fall 2020

Click on the below link to download the file

CS604_Assignment_No_02_Solution_Fall_2020

CS604-Assignment-2-IDEA-SOL-2020

Click on the below link to download the file

CS604-Assignment-2-IDEA-SOL-2020

Does anybody have a solution Idea?

Due date is December 16, 2020

CS604 Assignment No.2 Solution Fall 2020 (Part I)

CS604 (Operating System) Assignment No.2 Solution Fall 2020 (Part I)

Question No. 1 12 Marks Considering the two processes SP (Server Process) and CP Client Process, each creates two child process sc1, sc2, and cc1, cc2, respectively. These processes create two FIFOs, FIFO 1 for reading and FIFO 2 for writing in SP and FIFO 1 for writing and FIFO2 for reading in CP to communicate with each other as shown in the figure. By considering the above scenario, you are required to write the output of the following code snippets. Question No. 2 08 Marks Consider the following set of processes, with the Arrival time and CPU burst time, is given in milliseconds: Process Arrival Time Burst Time P1 0.0 10 P2 2.0 6 P3 3.0 2 Considering the time slice of 4 milliseconds. A. Draw a Gantt chart showing the execution of these processes using the Shortest Remaining Time First (SRTF) scheduling. B. Calculate the turnaround time of each process for the Shortest Remaining Time First scheduling algorithm as per part Calculation of part A? C. Calculate the waiting time of each process for the SRTF scheduling algorithm as per the calculation of Part A?

CS604 Assignment 2 Fall 2020 Solution idea:

 

CS604 complete solution assignment no 02 fall 2020

Click on the below link to download the file

CS604_Assignment_No_02_Solution_Fall_2020

CS604-Assignment-2-IDEA-SOL-2020

Click on the below link to download the file

CS604-Assignment-2-IDEA-SOL-2020

#Solution of #CS604 #Assignment 2 #Fall2020 by #Washi - Operating Systems

In this video we learn learn and understand inter-process communication using FIFOs. To learn scheduling algorithm (SRTF) how to draw Gantt Chart using SRTF, calculate completion time, turnaround time and waiting time
#Solution of #CS604 #Assignment 2 #Fall2020 by #Washi - Operating Systems

RSS

Looking For Something? Search Below

Latest Activity

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