All Exams Test series for 1 year @ ₹349 only
Question

Given a CPU time slice of 2 ms and the following processes, assume zero context-switch cost. When an arrival coincides with quantum expiry, enqueue the arriving process before requeuing the preempted process.

Process

Burst time (ms)

Arrival time (ms)

p 1

3

0

p 2

4

2

p 3

5

5

Find average turnaround time and average waiting time using round-robin CPU scheduling?

The correct answer is

\(\frac{17}{3}\text{ ms},\ \frac{5}{3}\text{ ms}\)

The schedule is P1: 0–2, P2: 2–4, P1: 4–5, P2: 5–7, then P3: 7–12 (with quantum boundaries at 9 and 11). Completion times are 5, 7 and 12 ms. Turnaround times are 5, 5 and 7 ms; subtracting burst times gives waiting times 2, 1 and 2 ms. The averages are \(17/3\text{ ms}\) and \(5/3\text{ ms}\), approximately 5.67 ms and 1.67 ms.

Was this answer helpful?

Important Questions from Process Scheduling - Teaching

  1. Consider the following 3 processes with the length of the CPU burst time given in milliseconds :

    ProcessArrival TimeBurst Time
    P108
    P214
    P329

    What is the average waiting time for these processes if they are scheduled using preemptive shortest job first scheduling algorithm?

  2. Consider the following four processes with the arrival time and length of CPU burst given in milliseconds :

    ProcessArrival TimeBurst Time
    P 108
    P 214
    P 329
    P 435

    The average waiting time for preemptive SJF scheduling algorithm is

  3. Which of the following is not a CPU scheduling Algorithm?

  4. Which of the following statement(s) is/are true about CPU scheduling algorithm?

    I. Shortest remaining time first scheduling may cause starvation

    II. Round Robin is better than First Come First Serve in terms of response time

  5. Processes P1, P2, P3 and P4 have CPU burst times 5, 7, 6 and 4 ms, respectively. All arrive at time 0, and the initial ready-queue order is P1, P2, P3, P4. Using Round-Robin scheduling with a 4 ms time quantum and no context-switch overhead, what is P4’s total waiting time in milliseconds?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App