Operating System Fundamentals - Unit 9 - Week 6
Operating System Fundamentals - Unit 9 - Week 6
com
Course outline
About NPTEL
Week 0
Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Lecture Materials
Assignment 6 Solution
Week 7
Week 8
Week 9
Week 10
Week 11
Download Videos
Text Transcripts
Books
Week 6 : Assignment 6
The due date for submitting this assignment has passed.
Due on 2024-09-04, 23:59 IST.
As per our records you have not submitted this assignment.
1) Assume that the following processes are scheduled using the Shortest-Job-First process scheduling policy. 1 point
Determine the average waiting time.
P1 1 3
P2 0 2
P3 3 2
P4 2 4
(A) 3.5
(B) 2.5
(C) 1.5
(D) 4.5
(E) 0.5
2) Choose the correct statement about "Exponential Averaging" when predicting the next CPU burst length in SJF 1 point
scheduling.
(A) Exponential Averaging gives equal weight to all past CPU bursts.
(B) Exponential Averaging discards all previous history when predicting the next burst length.
(C) Exponential Averaging gives more weight to the recent CPU bursts while still considering the entire history.
(D) Exponential Averaging is only applicable to non-preemptive scheduling algorithms.
(E) Exponential Averaging requires a fixed-size queue to store past burst lengths.
3) The following processes are scheduled using the Robin process scheduling policy with a time quantum of 3ms. 1 point
Determine the average waiting time.
P1 0 6
P1 1 2
P3 3 8
P4 5 3
P5 2 4
(A) 5.6
(B) 8.6
(C) 7.6
(D) 4.5
(E) 6.6
4) Assume the following processes are scheduled using the Priority Scheduling process scheduling algorithm. 1 point
Determine the average waiting time. Assume a lower value in priority means higher priority.
P1 2 2 0
P1 1 3 0
P3 3 5 0
P4 5 7 0
P5 4 4 0
(A) 6.4
(B) 5.0
(C) 6.8
(D) 5.8
(E) 5.2
5) Which of the following process scheduling algorithms does not suffer from the starvation problem? 1 point
6) The "Progress" condition in the context of the Critical Section Problem refers 1 point
(A) If no process is in the critical section and some processes wish to enter it, the selection of the next process must not
be indefinitely postponed.
(B) Only one process can be in the critical section at a time.
(C) No process should wait forever to enter the critical section.
(D) If a process is in the critical section, no other process can enter until it has finished.
(E) Processes must be allowed to enter the critical section based on their priority.
7) The “race condition” in the context of the critical section problem 1 point
(A) occurs when multiple processes enter their critical sections simultaneously, leading to unpredictable results.
(B) happens when a process is forced to wait indefinitely before entering its critical section.
(C) arises when the OS fails to schedule processes fairly.
(D) refers to the situation where two or more processes compete for CPU.
(E) is a condition where a process preempts another process in the middle of its critical section.
8) The solution to the critical section problem ensures which of the following(s)? 1 point
9) Consider the producer-consumer problem with a bounded buffer. The processes share a variable “count”. The initial 1 point
value of the count is 5, and the maximum size of the buffer is 10.
while (true)
{ while (true)
/* produce an item in {
next produced */ while (count == 0);
while (count == /* do nothing */
BUFFER_SIZE); next_consumed = buffer[out];
/* do nothing */ out = (out + 1) %
buffer[in] = BUFFER_SIZE;
next_produced; count = count - 1;
in = (in + 1) % /* consume the item in the
BUFFER_SIZE; next consumed */
count = count +1; }
}
Assume that the CPU schedules the producer-consumer problem as follows: SP0, SC0, SP1, SC1, SP2, and SC2. What is
the final value of the count?
(A) 6
(B) 4
(C) 5
(D) 3
(E) 2
10) To solve the critical section problem, the general structure of a process Pi includes 1 point