task status in Xenomai
Hi All,
Can someone please tell me where I can find the documentation regarding the
task status transition (is there a state machine describing that)? Also, how the status values are defined? By reading rt_task_info::status during program execution, I can get some values. For example, while a task is running, I got a decimal of 3146112 for the task's rt_task_info::status. It seems this value is OR'ed with some macros, but what values are used to produce this status value? Where are they defined?
Thanks,
Tom
Quoted 4 lines · Tom Z
Hi All,
Can someone please tell me where I can find the documentation regarding the task status transition (is there a state machine describing that)?
see include/nucleus/thread.h. Roughly, the main transitions are:
XNDORMANT ---(task_start)--> XNREADY ---(scheduled in)--> [running]
[running] ---(preemption)--> XNREADY
--(task_delete)--> XNZOMBIE --> [flushed]
--(task_suspend)--> XNSUSP --(scheduled out)->
--(wait on synchronization)--> XNPEND --(scheduled out)->
--(timed wait)--> XNDELAY --(scheduled out)->
XNSUSP, XNPEND and XNDELAY are cumulative. Waiting on a synchronization object with a timeout leads to XNPEND | XNDELAY, otherwise XNPEND only. Sleeping on a mere timeout only involves XNDELAY in the status.
Also, how the status values are defined? By readingrt_task_info::status during program execution, I can get some values. For example, while a task is running, I got a decimal of 3146112 for the task's rt_task_info::status. It seems this value is OR'ed with some macros, but what values are used to produce this status value? Where are they defined?
Quoted 1 line
check include/native/task.h, T_* bits for the native API. Most of them are aliases to the XN* bits discussed above. 3146112 (0x300180), would mean XNOTHER|XNUSER|XNMAPPED|XNSTARTED, which tags a non real-time userland task shadowed by a Xenomai control block, basically meaning that it may pend on real-time resources (sema4s, queues, condvars, mutexes, etc), but won't contend for the CPU with real-time (i.e. non-zero priority) Xenomai tasks.
Quoted 8 lines
Thanks,
Tom
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai
Signature · 1 line
Philippe.