DATE 10-10-2022
Real Time Systems
ASSIGNMENT
Santosh V Hegde
Assignment : Semester-1
Reg.No : 2022HT01035
Email : [email protected]
Q1. Show that the following tasks table is schedulable using EDF on a mono-core processor, if pre-emp on is allowed but is not
schedulable if pre-emp on is not allowed. All tasks are aperiodic. Deadline specified is absolute deadline.
J1 J2 J3
r 0 3 5
e 3 6 5
d 12 14 8
Solu on:
1 At T0 Job 3 will start since it has the earliest Deadline among 3 given jobs (5), But Job 3 gets ready at 5-time unit only.
2 At T0 Job 1 is ready and get released at 0 and continue till T3.
3 At T3 Job 2 gets released but still Job 3 is not yet released.
4 Job 2 executed at T3, T4 Time units. When T5, Job 3 released. Processor preempts the Job 3 over Job 2.
5 Job 3 Continues till T10. But Job 3 Deadline 8 and its being missed.
6 After Completion of Job 3 Job 2 will be taken and processed T14 the remaining time unit from the Job 3 Preempted and
executed
Cheddar Tool Output:
Condi on
1. Processor Core -1
2. EDF Algorithm
3. Preamtive
Date: 10-10-2022
RTS 1
For Non-Preemp ve Cheddar So ware Output
Processor U liza on is 1.303571429. if these tasks are no Pre-emp ve, Processor U liza on is Greater than 1. This Jobs cannot
be scheduled using EDF Method.
Date: 10-10-2022
RTS 2
Q2 Show that the following tasks table is schedulable using LLF but not using EDF on a dual-core processor. All tasks are
aperiodic. Consider that the various instances if the task can be migrated across various processors.
J1 J2 J3
r 0 0 0
e 1 1 5
d 1 2 5
Solu on
Slack = Deadline - me - Remaining Execu on me
LLF Algorithm
For the task given Slack me calcula on –
J1 0 -1 -2 -3 -4 -5
J2 1 0 -1 -2 -3 -4
J3 0 0 0 0 0 0
Chart
1. At T0, J1 and J3 has 0 Slack and executed by Core – 1 and Core -2.
2. At T1, J1 already Performed and both J3, J2 got same slacks. J3 and J3 executed by Core. Since Core -2 started execution for
J3 at T0, it will continue. J2 scheduled to Core-1
3. From T2, J1 and J2 already executed, J3 will continue to execute by Core -2. Here Core-1 is not used to execute J3. Because
Core-2 already started executing J3.
EDF Algorithm
Date: 10-10-2022
RTS 3
Cheddar Verifica on
1. At T0, Job-1 and Job-2 are executed by Core-1, Core-2, Since their deadline are 1, 2 respectively.
2. At T1, Job-3 start executing but unsuccessful to complete on its deadline.
3. Since Deadline is Missed and one job did not complete. Conclusion is - These job sets cannot be scheduled using EDF
algorithm.
Cheddar Verifica on
Total U liza on = 2.5 and 2.5 > 1. (>100%) This proves EDF is not recommended for these tasks.
Date: 10-10-2022
RTS 4
Q3. The task set T1 = (3, 1), T2 = (5, 1.5), T3 = (7, 1.25), T4 = (9, 0.5) are scheduled based on RM algorithm. Check whether the
task set can be feasibly schedule. Do the schedulable test and verify using cheddar simulator.
Solu on-
Rate Monotonic Algorithm ----> Shorter the Period Higher the Priority
Execution
Period Deadline
Time
T1 3 3 1
T2 5 5 1.5
T3 7 7 1.25
T4 9 9 0.5
In this case -
Task 1 Highest
Task 2 Higher than 3 and 4
Task 3 Lower than 1 and 2 but higher than 4
Task 4 Lowest
Processor U liza on = (T1ET/T1P) +(T2ET/T2P) +(T3ET/T3P) +(T4ET/T4P) = (1/3) +(1.5/5) +(1.25/7) +(0.5/9)
Total U liza on: U = 1/3 + 1.5/5 + 1.25/7 + 0.5/9 = 0.858 < 1. [This task set is schedulable]
Urm = m (2^1/m -1) [m = 4]
Urm = 4(2^ (1/4-1)) = 0.756 -> U > Urm.
Here U > Urm, Not Sa sfied the Condi on U < Urm. But this doesn’t mean that these task cannot be schedulable. We can check in
Lehoczky’s Test.
Task 1:
- 1 < 3 .Execution Time is less than Deadline. So it is schedulable
Task 2:
- 1.5+ (Smallest Integers Not less than 5/3*1) = 1.666
- Smallest Integers Not less than = 1.666667 is 2
- < 5. Less than it's Deadline
T2 is schedulable.
Task 3:
- 1.25+ (Smallest Integers Not less than 7/5*1.5)+(Smallest Integers Not less than 7/3*1)
= 1.25 + 3 + 3 = 7.25
- 7.25 > 7. Greater than its Deadline
T3 is not schedulable.
Task 4:
- 0.5+ (Smallest Integers Not less than 9/7*1.25)+(Smallest Integers Not less than 9/5*1.5)+(Smallest Integers Not
less than 9/3*1) = 0.5 + 2 + 3 +3 = 8.5
- 8.5 < 9 lesser than its deadline. 1.5 + (5/9) X0.5 = 1.77 < 5
T4 is schedulable.
Result:
Task 1, Task 2 and Task 4 Can be Scheduled Using Rate Monotonic algorithm. But Task 3 cannot be scheduled using the same
method. So, these tasks sets doesn’t meet schedule requirements to use RMA Method.
Date: 10-10-2022
RTS 5
Q4]. For the task set given T1 (2,1) T2(5, 2.5) check whether they can be scheduled under EDF and RM algorithms. Use
Schedulability test and also verify the same in cheddar simulator.
Period Deadline Execution Time
Task 1 2 2 1
Task 2 5 5 2.5
Task 1 -> High / Task 2 -> Low / Task 1 > Task 2
Schedulability test for RMA:
Rate Monotonic Algorithm ----> Shorter the Period Higher the Priority
Urm = m (2^1/m -1) = 2(1.41-1) = 0.828
U > Urm.
Lehoski’s test:
Priority: T1 > T2
Task 1:
1 < 2. Execution time is lesser than Deadline.
Task 1 is schedulable.
Task 2:
2.5+ (Smallest Integers Not less than 5/2*1) = 2.5 + 3 = 5.5
5.5 > 5. Here, It’s greater than Deadline.
Task 2 cannot be scheduled By RMA Method.
Conclusion:
This Task set is not Schedulable by using RMA Method
Schedulability test for EDF:
EDF - Earliest Deadline First
Schedulability test Condi on
Total U liza on = (T1E/T1D) + (T2E/T2D) <= 1
U = [(1/2) + (2.5/5)] = 1
This Task set is Schedulable by using EDF Algorithm.
1. Time slot 0, T 1 Will be performed for 1 Time slot.
2. Time slot 1, T 1 is completed and task 2 will be executed for 1 slot.
3. Time slot 2, task 1 Instance 2 will be imitated and completed by 3 because it has the earliest deadline of 4th time slot.
4. Time slot 3, T 1 Instance 2 will be completed and T 2 Instance 1 will be taken and will be performing remaining time slot till
4.5 Because, T 1 Instance 3 has the deadline of 6. But T 2 Instance 1 has the deadline of 5. Since Earliest deadline first
algorithm task 2 will be having more priority than T 1.
5. After Completion of T 2 Instance 1 T 1 Instance 3 will be taken at 4.5 time slot.
Conclusion: This Task set is Schedulable by using EDF Algorithm.
Date: 10-10-2022
RTS 6