edited by
38,065 views
105 votes
105 votes
Consider a uniprocessor system executing three tasks $T_{1}, T_{2}$ and $T_{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, which is the highest priority task scheduled first. Each instance of $T_{1}, T_{2}$ and $T_{3}$ requires an execution time of $1, 2$ and $4$ milliseconds, respectively. Given that all tasks initially arrive at the beginning of the $1^{\text{st}}$ millisecond and task preemptions are allowed, the first instance of $T_{3}$ completes its execution at the end of_____________________milliseconds.
edited by

14 Answers

1 votes
1 votes
I think those who started with 1 ms are correct. The question asks "the first instance of T3 completes its execution at the  END of which millisecond and thus 12 is the right answer.
1 votes
1 votes

Solution:-

 

edited by
1 votes
1 votes

For those who are getting answers as 13 please note that its 13 units on Gantt chart and all process arrive at 1ms. Hence final result of 13 has to be subtracted by 1.

Hence completion time of T3(in ms) is 13-1=12 ms

Hence answer is 12 ms. 

For clear understanding see the solution below where I have showed 1ms on Gantt chart. 

Answer:

Related questions

48 votes
48 votes
6 answers
11
makhdoom ghaya asked Feb 12, 2015
12,340 views
The following two functions $P1$ and $P2$ that share a variable $B$ with an initial value of $2$ execute concurrently.$$\begin{array}{|l|l|}\hline \text{P1() \{ } & \tex...
31 votes
31 votes
2 answers
12