I am trying to understand how preemptive multitasking works. I don't understand how all tasks will be executed. once I understand the basics I will try to write plain c code, not for specific MCU but It should show some basic ideas for preemptive multitasking design
I am taking the following example after searching on the google
LCM of the time period of all tasks is 40ms
40ms/8ms = 5
40ms/5ms = 8
40ms/10ms = 4
I don't understand how tasks will be executed between 15ms and 40ms?
Table for task execution on priority
can you @djsfantasi @click_here help in this matter
I am taking the following example after searching on the google
- I assume that we have three tasks.
- Each task has its own execution time.
- Each task needs to be completed within the time limit.
- Each task has a priority that should be followed.
- system time tick 1ms
LCM of the time period of all tasks is 40ms
40ms/8ms = 5
40ms/5ms = 8
40ms/10ms = 4
I don't understand how tasks will be executed between 15ms and 40ms?
Table for task execution on priority
Code:
1--------> T2 running
2--------> T2 running
3--------> T2 running
4--------> T2 running
5--------> T2 running
6--------> T1 running
7--------> T1 running
8--------> T1 running
9--------> T1 running
10-------> T1 running
11-------> T1 running
12-------> T1 running
13-------> T1 running
14------->
15------->
16------->
17------->
18------->
19------->
20------->
21------->
22------->
23------->
24------->
25------->
26------->
27------->
28------->
29------->
30------->
31------->
32------->
33------->
34------->
35------->
36------->
37------->
38------->
39------->
40------->
continue
Last edited: