GateAI
CPU and I/O Scheduling

GATE CSE 2015 Set 1 · Q46

NAT2 marksMedium

Time

Consider a uniprocessor system executing three tasks T1T_1, T2T_2 and T3T_3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1T_1, T2T_2 and T3T_3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st1^{\text{st}} millisecond and task preemptions are allowed, the first instance of T3T_3 completes its execution at the end of _________ milliseconds.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 12

CPU and I/O Scheduling

We are given three periodic tasks under Rate Monotonic Scheduling (priority ∝1period\propto \frac{1}{\text{period}}):

  • Task T1T_1: Period P1=3 msP_1 = 3\text{ ms}, Execution time C1=1 msC_1 = 1\text{ ms} (Highest Priority)

  • Task T2T_2: Period P2=7 msP_2 = 7\text{ ms}, Execution time C2=2 msC_2 = 2\text{ ms} (Medium Priority)

  • Task T3T_3: Period P3=20 msP_3 = 20\text{ ms}, Execution time C3=4 msC_3 = 4\text{ ms} (Lowest Priority)

All tasks arrive at t=0t = 0.

Let us trace the execution timeline from t=0t = 0:

  1. t=0t = 0 to 11: T1T_1 (Instance 1) runs for 1 ms1\text{ ms} and finishes at t=1t = 1.

  2. t=1t = 1 to 33: T2T_2 (Instance 1) runs for 2 ms2\text{ ms} and finishes at t=3t = 3.

  3. t=3t = 3 to 44: T1T_1 (Instance 2 arrives at t=3t = 3) preempts, runs for 1 ms1\text{ ms}, and finishes at t=4t = 4.

  4. t=4t = 4 to 66: T3T_3 (Instance 1) runs for 2 ms2\text{ ms} (2 ms2\text{ ms} remaining).

  5. t=6t = 6 to 77: T1T_1 (Instance 3 arrives at t=6t = 6) preempts, runs for 1 ms1\text{ ms}, and finishes at t=7t = 7.

  6. t=7t = 7 to 99: T2T_2 (Instance 2 arrives at t=7t = 7) runs for 2 ms2\text{ ms} and finishes at t=9t = 9.

  7. t=9t = 9 to 1010: T1T_1 (Instance 4 arrives at t=9t = 9) runs for 1 ms1\text{ ms} and finishes at t=10t = 10.

  8. t=10t = 10 to 1212: T3T_3 (Instance 1) resumes and executes its remaining 2 ms2\text{ ms}, finishing at t=12t = 12.

Thus, the first instance of T3T_3 completes its execution at the end of 12 milliseconds.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This CPU and I/O Scheduling previous year question is Q46 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on CPU and I/O Scheduling in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CPU and I/O Scheduling PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

CPU and I/O Scheduling in GATE CSE

CPU and I/O Scheduling has 25 GATE CSE PYQs across 22 papers from 2011 to 2026. 10 of them are 2-mark NAT questions like this one, and GATE CSE 2015 Set 1 has 2.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q46 · NAT

Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of … milliseconds.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.