0
1.2kviews
In a real time system, four tasks are computing for processor time having following properties. Determine if tasks can meet the deadline. Graphically illustrate EDF and LSTF scheduling scheme.
Task T1 T2 T3 T4
Priority 4 3 2 1
Execution time 4 3 4 2
Start time 0 3 5 8
Deadline 9 8 14 16
1 Answer
0
0views

Total execution time = 4 + 3 + 4 + 2 = 13.

Total execution time is less than farthest deadline. Therefore, the tasks are schedulable and they can meet the deadline.

Explanation:

1. EDF:

  • Task T1 starts execution first as it's start time is 0 and continues its execution till 3sec.
  • At 3 sec task T2 starts as its start time is 3 sec and it has an early deadline.
  • Task T2 continues execution for 3sec as its execution time is 3 sec and ends at 6sec. Although task T3 has start time at 5sec it does not start because it's deadline is 14sec.
  • After task T2 ends, Task T1 resumes its execution because task T1 has an earlier deadline than task T3 and completes its remaining 1 sec of execution.
  • Task T3 starts after T1. Task T3 completes its execution of 4sec without any interruption because deadline of task T4 is farther than T3.
  • At 11sec task T4 starts after completion of task T3. Task T4 completes its execution of 2 sec.

2. LSTF:

i) Initially mark all the start points of all the tasks.

ii) Here, as task T1 has start time 0sec, therefore T1 starts to execute.

iii) At the next start time, i.e. at 3sec task T2 enters and T1 is still executing. Therefore slack times of T1 and T2 at 3 sec are compared.

Slack Time = deadline - time instant - remaining execution time.

(a) At time = 3 sec;

Slack Time of T1 = 9 - 3 - 1= 5 sec

Slack Time of T2 = 8 - 3 - 3 = 2 sec

As slack time of T2 is less than T1, therefore T2 starts executing from time equal to 3sec.

iv) At 5sec task T3 enters and again slack times of T1, T2 and T3 are compared.

(b) At time = 5 sec;

Slack Time of T1 = 9 - 5 - 1 = 3 sec

Slack Time of T2 = 8 - 5 - 1 = 2 sec

Slack Time of T3 = 14 - 5 - 4 = 5 sec

As slack time of T2 is least among others, the execution of T2 continues.

v) At 6sec execution of T2 is completed. Now at 6sec the slack times of T1 and T3 are compared.

(c) At time = 6 sec;

Slack Time of T1 = 9 - 6 - 1 = 2 sec

Slack Time of T3 = 14 - 6 - 4 = 4 sec

As slack time of T1 is less, execution of T1 resumes.

vi) After T1 completes its execution, T3 starts executing as start time of T4 is 8sec.

vii) At 8sec, T4 enters and slack times of T3 and T4 are compared.

(d) At time = 8 sec;

Slack Time of T3= 14 - 8 - 3 = 3 sec

Slack Time of T4 = 16 - 8 - 2 = 6 sec

As slack time of T3 is less than T4, T3 continues its execution and is completed at 11sec.

viii) Task T4 starts after completion of task T3. After 2sec of its execution time, task T4 ends.

Please log in to add an answer.