I3MUP1+Exercise+13

toc =Exercise 1 – FIFO, SJF and SRT scheduling= Schedule the following three tasks using FIFO, SJF and SRT scheduling algorithms.


 * **Task** || **Arrival Time** || **Service Time** ||
 * T1 || 0 || 4 ||
 * T2 || 0 || 2 ||
 * T3 || 3 || 1 ||

Exercise 1-1
Fill in the below table with the value of the priority function for each of the tasks at the time specified

Exercise 1-2
Use the values above to determine the schedule for the tasks and draw it in the below graph

=Exercise 2= Schedule the following tasks using RM and EDF scheduling (their priority functions are listed to the right for easy reference):


 * **Task** || **Arrival Time** || **Service Time** || **Period** ||
 * T1 || 0 || 1 || 4 ||
 * T2 || 0 || 3 || 5 ||

Exercise 2.1
Fill in the below table with the value of the priority function for each of the tasks at the time specified

Exercise 2.2
Use the values above to determine the schedule for the tasks and draw it in the below graph

=Exercise 3=

Exercise 3.1
A system consists of 5 tasks, τ1, thru τ5. The tasks are independent (they do not share any resources). Can this system be scheduled?

math U_j = C_j / T_j math

math U(n) = n(^n\sqrt{2}-1) math

Følgende skal gælde

math \sum_{j=1}^5 { U_j }\! =(10/60)+(15/80)+(50/150)+(10/250)+(6/500) = 0.7395 math

math U(5) = 5(^5\sqrt{2}-1) = 0.743492 math

math 0.7395 < 0.743492 math

Ja, det kan det.

Exercise 3-2
Repeat Exercise 1 but assume that τ5 executes for 8ms. Can the system be scheduled?

Samme princip som i forrige opgave benyttes: math \sum_{j=1}^5 { U_j }\! =(10/60)+(15/80)+(50/150)+(10/250)+(8/500) = 0.7435 math

math \sum_{j=1}^5 {U_j} > U(n) math math 0.7435 > 0.743492 math

Nej, det kan det ikke.

Exercise 3-3
A system consists of three tasks, τ1, τ2 and τ3. Two tasks, τ1 and τ3, share a resource A as outlined below. Can the system be scheduled?

Exercise 3-4
Repeat Exercise 3 but assume that τ2 executes for only 23ms. Can the system be scheduled?

=Exercise 4= A simple sensor data display system consists of four tasks: A SensorReader, a Calculator, a GUIUpdater and a Watchdog. The system is sketched below:

Exercise 4a
Assume that the data sharing is performed without blocking. Is the system schedulable? If not, what can be done to make it schedulable?

The SensorReader uses 2.200 instructions to sample the sensor. Furthermore, it uses 25 instructions to pass sensor data to the resource ‘A’ which it shares with the Calculator. - The Calculator uses 26.000 instructions to perform calculations on sensor data. Furthermore, it uses 25 instructions to retrieve sensor data from the resource ‘A’ and another 25 instructions to pass data to the resource ‘B’ it shares with the GUIUpdater - The GUIUpdater uses 16.000 instructions to update the GUI. Furthermore, it uses 25 instructions to retrieve GUI data from the resource ‘B’. - The Watchdog uses 200 instructions to reset the watchdog timer.

Exercise 4b
//Assume that tasks block each other on data transferral. Is the system schedulable? If not, what can be done to make it schedulable?//