Homework Assignment 3 - Operating Systems | COP 4610, Assignments of Operating Systems

Material Type: Assignment; Class: OPERATING SYSTEMS; Subject: COMPUTER PROGRAMMING; University: Florida State University; Term: Spring 2006;

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-ioy
koofers-user-ioy 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COP4610 Spring 2006 Homework Assignment 3
The material for this homework assignment covers Chapters 5 to 7.
1. Which of the scheduling algorithms FCFS, SJF, RR, or Priority could result in
starvation?
2. Consider the following set of processes, with the length of the CPU burst time and
arrival time given in milliseconds:
Process Arrival time Burst time Priority
P1052
P2231
P3385
P4314
P5623
Draw the Gandtt charts to illustrate the execution of the processes using the
following scheduling algorithms:
FCFS
SJF (preemptive)
Priority (preemptive)
RR with quantum = 3
3. Determine the average waiting time of the processes for each of the scheduling
algorithms in exercise 2.
4. Consider the following attempt to solve the mutual exclusion problem:
i = process_id(); // pid = 0 or 1
while (true)
{ while (turn == i)
; // no-op
Critical section
turn = 1-turn;
Remainder section
}
Variable turn is shared with initial value 0 and variable i is private. Suppose we
have two processes, P0 and P1, that want to enter the critical section.
pf2

Partial preview of the text

Download Homework Assignment 3 - Operating Systems | COP 4610 and more Assignments Operating Systems in PDF only on Docsity!

COP4610 Spring 2006 Homework Assignment 3

The material for this homework assignment covers Chapters 5 to 7.

  1. Which of the scheduling algorithms FCFS, SJF, RR, or Priority could result in starvation?
  2. Consider the following set of processes, with the length of the CPU burst time and arrival time given in milliseconds: Process Arrival time Burst time Priority P 1 0 5 2 P 2 2 3 1 P 3 3 8 5 P 4 3 1 4 P 5 6 2 3 Draw the Gandtt charts to illustrate the execution of the processes using the following scheduling algorithms: FCFS SJF (preemptive) Priority (preemptive) RR with quantum = 3
  3. Determine the average waiting time of the processes for each of the scheduling algorithms in exercise 2.
  4. Consider the following attempt to solve the mutual exclusion problem: i = process_id(); // pid = 0 or 1 while (true) { while (turn == i) ; // no-op Critical section turn = 1-turn; Remainder section } Variable turn is shared with initial value 0 and variable i is private. Suppose we have two processes, P0 and P1, that want to enter the critical section.

Suppose we have only one process that wants to enter the critical section. Describe why the process could deadlock.

  1. Textbook exercise 6.8 at page 233.