# CS703 Assignment 2 Solution and Discussion

• CS703 – Advanced Operating Systems

Due Date: 4-12-2019
Total Marks 50

Assignment 2

Instructions to Solve Assignments

The purpose of assignments is to give you hands on practice. It is expected that students will solve the assignments themselves. Following rules will apply during the evaluation of assignment.

• Cheating from any source will result in zero marks in the assignment.
• Any student found cheating in any two of the assignments submitted will be awarded “F” grade in the course.
• No assignment after due date will be accepted.

Question 1: Total Points (10)
Consider performance of FCFS algorithm for three computer-bound processes. If process P1 takes 25 seconds, P2 takes 4 seconds and P3 takes 5 seconds and processes arrive in the given order P1, P2, P3. You need to calculate the following:
a) Turnaround Time per process.
b) Average Turnaround time of processes

Question 2: Total Points (10)

Calculate the Average Waiting Time for four processes. Assume that Processes arrives in the given sequence P1, P2, P4 and P3 at time=0 and scheduling algorithm applied is FCFS.

Processes CPU Burst
P1 5
P2 4
P3 2
P4 3

Question 3: Total Points (15+15=30)
Read the paper titled “Boosting the Cloud Meta-Operating System with Heterogeneous Kernels. A Novel Approach Based on Containers and Micro services”
”, and answer the following questions:
(a) Write the brief summary of the given paper.
(b) Write a short note on the Meta Operating system discussed in the paper.
Note: Research paper is available in the zip folder.

• Question 1: Total Points (10)
Consider performance of FCFS algorithm for three computer-bound processes. If process P1 takes 25 seconds, P2 takes 4 seconds and P3 takes 5 seconds and processes arrive in the given order P1, P2, P3. You need to calculate the following:
a) Turnaround Time per process.
b) Average Turnaround time of processes

• Ideas Solution Example

Scheduling Algorithms
The following subsections will explain several common scheduling strategies, looking at only a single CPU burst each for a small number of processes. Obviously real systems have to deal with a lot more simultaneous processes executing their CPU-I/O burst cycles.
6.3.1 First-Come First-Serve Scheduling, FCFS

FCFS is very simple - Just a FIFO queue, like customers waiting in line at the bank or the post office or at a copying machine.
Unfortunately, however, FCFS can yield some very long average wait times, particularly if the first process to get there takes a long time. For example, consider the following three processes:

Process Burst Time
P1 24
P2 3
P3 3

In the first Gantt chart below, process P1 arrives first. The average waiting time for the three processes is ( 0 + 24 + 27 ) / 3 = 17.0 ms.
In the second Gantt chart below, the same three processes have an average wait time of ( 0 + 3 + 6 ) / 3 = 3.0 ms. The total run time for the three bursts is the same, but in the second case two of the three finish much quicker, and the other process is only delayed by a short amount.  FCFS can also block the system in a busy dynamic system in another way, known as the convoy effect. When one CPU intensive process blocks the CPU, a number of I/O intensive processes can get backed up behind it, leaving the I/O devices idle. When the CPU hog finally relinquishes the CPU, then the I/O processes pass through the CPU quickly, leaving the CPU idle while everyone queues up for I/O, and then the cycle repeats itself when the CPU intensive process gets back to the ready queue.

• b) Average Turnaround time of processes

Waiting time - How much time processes spend in the ready queue waiting their turn to get on the CPU.

``( Load average - The average number of processes sitting in the ready queue waiting their turn to get into the CPU. Reported in 1-minute, 5-minute, and 15-minute averages by "uptime" and "who". )``

• a) Turnaround Time per process.

Turnaround time - Time required for a particular process to complete, from submission time to completion. ( Wall clock time. )  | |