 www.vustudents.ning.com

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

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)

{

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;

}

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: 1528

Replies to This Discussion

Share the Assignment Questions & Discuss Here....

CS604 complete solution assignment no 02 fall 2020

CS604_Assignment_No_02_Solution_Fall_2020

CS604-Assignment-2-IDEA-SOL-2020

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

CS604_Assignment_No_02_Solution_Fall_2020

CS604-Assignment-2-IDEA-SOL-2020