GATE - 2015 | OS | Consider a uniprocessor system executing three tasks T1, T2 and T3

GATE - 2015 | OS | Consider a uniprocessor system executing three tasks T1, T2 and T3
Posted on 10-02-2022

GATE - 2015 [Operating System]

Question:

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.

A

13

B

12

C

15

D

16

  

Solution:

Option (B) is Correct.

All the processes or tasks are available at the beginning of 1st millisecond, which means at t=0. So, the Gantt chart will be as follows:

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.

∴ At the end of 12 milliseconds, 1st instance of T3 will complete its execution.

Thank You