How does vxWorks handle two tasks with the same priority?

We have two tasks (T1 and T2) in our built-in vxWorks system, which have the same priority (110).
How does the regular vxWorks scheduler handle this if both tasks are ready to run?
Which task is performed first?

+3
source share
3 answers

The task that will be executed first is the task that is first generated, as implemented by the VxWorks scheduler task. VxWorks uses a priority-based schedule by default . Thus, in your case, since T1 and T2 have the same priority, depending on which one the processor receives, it will continue to work indefinitely until it is explicitly blocked (using taskSuspend or taskDelay), after why another READY task will be executed until it is blocked, and so on. This should be controlled by semaphores or mutexes (mutices?)

. ? , , . , VxWorks, ( ), , . , . , , .

+5

VxWorks 256 (0 - , 255 - ). CPU . , .

3 A, B, C. , A .
A (taskDelay, SemTake, msgQReceive), B .
A , . B, C, A.
B C, .....

Round Robin (Time slicing), , , .

, , , . A , , . .

+2

By default, the one that is spawned by the first will be executed, and if it does not give up the CPU, the other will never start.

You can explicitly enable a loop than with a time interval.

+1
source

Source: https://habr.com/ru/post/1697019/


All Articles