Calculate the average waiting time

Assignment Help Operating System
Reference no: EM131887403

Assignment

Question 1

1. Given the following set of processes and the length of the CPU burst given in milliseconds, show how these processes are scheduled according to Round Robin scheduling. Use a time quantum of 2 milliseconds.

Process

Burst Time (ms)

P1

5

P2

4

P3

2

P4

3

a) Draw the Gantt-chart for the scheduling algorithm. Inside each box, write the name of the process and specify the start and end of each scheduled time below.

b) Calculate the average waiting time?

c) Which process has the longest waiting time?

Question 2

Given the following set of processes and the length of the CPU burst given in milliseconds:

Process

Burst Time (ms)

P1

5

P2

4

P3

2

P4

3

P5

7

 

a. Draw the Gantt-chart for the above processes using Shortest Job First Scheduling algorithm.

b. Calculate the average waiting time?

c. Which process has the longest waiting time?

Question 3

a. What is a race condition? Explain with example.

b. What do you mean by counting semaphore?

Question 4

What are the disadvantages of Peterson's solution for critical-section problem? Code below shows the solution to two process mutual exclusion problem.

Process Pi
do {
flag[i] = true;
turn = j;
while (flag[j] && turn == j);
critical section
flag[i] = false;
remainder section
} while (true);
Process Pj
do {
flag[j] = true;
turn = i;
while (flag[i] && turn == i);
critical section
flag[j] = false;
remainder section
} while (true);

Answer True or False to the following questions:

(i) This algorithm satisfies the "mutual exclusion", "progress" and "bounded waiting" condition.

ii) This algorithm has a flaw as the variable "turn" can be modified by both processes at the same time.

iii) This algorithm may cause "deadlock" if both processes set their flags to True at the same time.

iv) This algorithm satisfies only the "mutual exclusion" and "progress" condition.

Reference no: EM131887403

Questions Cloud

Energy in the fifth capacitor in micro-joules : If the equivalent capacitance of all five capacitors is 2.7 micro-farads, what is the stored energy in the fifth capacitor in micro-joules?
What do you think about the ideas in the article : You are to pick one of the topics you viewed above concerning "My Kid Would Never do That" and find an article that relates to that topic in parentheses
Vertical component of jeff velocity : When Jeff ran up a hill at 6.0 m/s, the horizontal component of his vector was 4.5 m/s. What was the vertical component of Jeff's velocity?
Operate on energy transmitted : State the energy transformation equation for the sun's energy eventually causing an oven to operate on energy transmitted through a wind turbine?
Calculate the average waiting time : Given the following set of processes and the length of the CPU burst given in milliseconds. Calculate the average waiting time?
What is the value of each capacitor in micro-farads : The total stored energy in the parallel configuration is 842 micro-joules greater than the series configuration. What is the value of each capacitor in micro
How being a immigrant can affect your health : I just need about one page nothing crazy. The paper just has to be on Immigration and how being a immigrant can affect your health.
Energy in the fifth capacitor in micro-joules : If the equivalent capacitance of all five capacitors is 3.4 micro-farads, what is the stored energy in the fifth capacitor in micro-joules?
Do we need to stop playing world policeman : Education in the United States is underfunded and defence budget is too high. Do we need to stop playing world policeman? Explain

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd