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

  Fundamentals of operating systems programming assignment 1

programming assignment 1 - deadlock avoidance with ljf plus ltbrgt ltbrgtedf-tie-breaker and edf plus ljf-tie-breaker

  What are the features that make them different

Why are there so many versions of OS? What are the features that make them different? Explain the pros and cons of each. How can the evolution of OS benefit an organization and cause harm to an organization?

  How to display thumbnails

It is run with the Xamarin Studio - The only thing I''m having trouble with is figuring out how to display thumbnails

  Value of semaphore before entering into critical section

Give a solution using Monitor that is starvation-free. What would be value of semaphore before entering into Critical Section and after leaving it.

  Mobile email and text messaging in the work place

What is a firm's fully qualified domain name and what is the significance of the. Discuss the benefits and drawbacks of mobile email and text messaging in the work place.

  Unix system calls and library functions

CS4760 Operating Systems, Unix System Calls and Library Functions, The goal of this homework is to become familiar with the environment in hoare while practising system calls.

  Define the shortest job first

For shortest job first, if the scheduler assigns a task to the processor, and no other task becomes schedulable in the meantime, will the scheduler ever.

  Unix and linux comparison matrix

UNIX and Linux Comparison Matrix, Choose three different versions of the UNIX or Linux operating systems to compare. Insert the three chosen versions and fill out the requested information in the Components column.

  Explain the difference between the chkdsk and scandisk cmnds

Explain the difference between the Copy command and the Xcopy command

  Open systems interconnection model

Discuss the drawbacks and benefits of each of these standards, OSI/CMIP, SNMP/Internet, and TMN. Give any enhancements to these standards.

  Point to point and end to end security models

Argue differences in point to point and end to end security models and security problems they address. Are they redundant?

  What does the imply about input validation checks used

What does this imply about input validation checks used to prevent command injection attacks?

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