115 views
1 1 vote

A system uses two feedback queues:

  • $\text{Q1}$: Round Robin with time quantum $10$ ms
     
  • $\text{Q2}$: Shortest Job First
     
  • $\text{Q1}$ has higher priority than $\text{Q2}$
     
  • New processes enter $\text{Q1}$
     
  • A process that does not finish after one quantum in $\text{Q1}$ moves to $\text{Q2}$

Initially both queues are empty.

Processes $\text{P1}$ and $\text{P2}$ are created in that order.

Their CPU burst times are:

  • $\text{P1}$: $30$ ms
     
  • $\text{P2}$: $20$ ms

What is their average waiting time?

  1. $25$ ms
     
  2. $20$ ms
     
  3. $15$ ms
     
  4. $10$ ms

1 Answer

1 1 vote

Both first enter $\text{Q1}$.

Schedule:

$0 - 10: \text{P1}$

$\text{P1}$ has $20$ ms remaining and moves to $\text{Q2}$.

$10 - 20: \text{P2}$

$\text{P2}$ has $10$ ms remaining and moves to $\text{Q2}$.

Now $\text{Q1}$ is empty.

$\text{Q2}$ uses SJF:

  • $\text{P2}$ remaining $= 10$ ms

  • $\text{P1}$ remaining $= 20$ ms

So,

$20 - 30: \text{P2}$

$30 - 50: \text{P1}$

Waiting time:

  • $\text{P1}$ waits from $10$ to $30 = 20$ ms

  • $\text{P2}$ waits from $0$ to $10 = 10$ ms


Average $:(20 + 10) / 2 = 15$ ms


Answer : C

Answer:
Position:
Show:

Related questions

3 3 votes
1 1 answer
88
88 views
GO Classes asked Aug 26
88 views
An underwater vehicle takes one photograph every minute during a $\textbf{1}$-hour mission.Each photograph is stored as a separate file of size $5$ kBAfter the mission, a...
3 3 votes
1 1 answer
88
88 views
GO Classes asked Aug 26
88 views
A demand-paging system has $3$ physical page frames.Consider the reference string:$\text{A, B, C, D, B, A, B, A, D, C}$Starting with empty memory, determine the total num...
2 2 votes
1 1 answer
117
117 views
GO Classes asked Aug 26
117 views
Consider an integer semaphore $\texttt{S}$.Method $\textbf{1}$wait(S): disable interrupts while S <= 0: do nothing S = S - 1 enable interrupts signal(S): disable interrup...
2 2 votes
2 2 answers
158
158 views
GO Classes asked Aug 26
158 views
A process $\text{P}$ contains a thread $\text{T}$. Thread $\text{T}$ opens a file and obtains file descriptor $\text{fd}$, and then creates two threads $\text{Ta}$ and $\...