Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

a)

Time 0 1 2 3 4 5 6 7 8 9 10 11
Task B A C C B A B C C
Time 12 13 14 15 16 17 18 19 20 21 22 23
Task B A B A C B C
Time 24 25 26 27 28 29 30 31 32 33 34 35
Task B A B c A c B
b)
For EDF we must first consider when each task repeats(period/deadline), by placing a
lower case of the task near the time number. Then at starting point all the tasks are ready, B is
executed first bc it has higher priority since it’s deadline is first, then A and then B. At each
lower case, you must consider if there is a ready task. Check if there is a ready task at each time
unit.

Time 0 b 1 2 3 4b 5 6a 7 8b 9c 10 11
Task B B A C B B C A B B C C
Time 12b,a 13 14 15 16 b 17 18a,c 19 20 b 21 22 23
Task B B A B B A C B B C
Time 24b,a 25 26 27 c 28 b 29 30 a 31 32 b 33 34 35
Task B B A C B B C A B B
For same priority, no preemption therefore at 30 C continues instead of A but there is still a
context switch.

4a)

Task 1 -> HW 3
Task 2 -> HW 2
Task 4 -> HW 4
Task 3 -> HW 2
Task 5 -> HW 1

Problem 5
ms 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 19
0 1 2 3 4 5 6 7 8
DSP D F
ARM Da H H
ADC M L
DAC C CL
H

8)

a) In static scheduling, the scheduler is done at design time. In a static scheduling, we can
see that dispatcher allocates processor on timer interrupt. This can be done with a timer
controlled by a table generated at design time. In a dynamic scheduler however the
table generated is computed during run-time.
b) Preemptive scheduling is scheduling whose tasks can be interrupted at any time of their
execution based on priorities. An example of this is that a task is interrupted by another
task that has a higher priority than the current process being executed.

Non-preemptive scheduling is scheduling whose tasks cannot be interrupted while they


are being executed.

c) Dispatcher – This module gives control of the CPU to the process selected by the short-
term scheduler, which involves:
- Context switching
- Switching to user mode
- Jumping to the proper location in the user program to restart the program

Feasible Schedule – is a schedule that fulfills application constraints for a given set of
tasks.

Optimal Schedule – is a feasible schedule that is found whenever any other scheduling
algorithm can do so.

You might also like