<div dir="ltr">Thank you for the clarification.<div><br></div><div>I am still having a hard time understanding this. What do you mean by no code which blocks? Does the thread which executes our task (Say a function Loop with 30k loops) block? What does block mean here?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 22, 2020 at 7:46 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 22/07/2020 15:36, Richi Dubey wrote:<br>
<br>
><br>
> Threads that get created automatically when a CPU starts have their <br>
> scheduler nodes with node->idle set to the thread itself, while the <br>
> nodes that are created due to a task being created have NULL in their <br>
> node->idle (If not using helper function atm). Am I right?<br>
><br>
> If yes, Why isn't the function _Scheduler_Set_idle_thread() called <br>
> by _Thread_Create_idle_for_CPU?<br>
><br>
> Trace:<br>
><br>
> exinit.c -> _Thread_Create_idle -> _Thread_Create_idle_for_CPU <br>
> -> _Scheduler_Start_idle -> _Scheduler_EDF_SMP_Start_idle <br>
> -> _Scheduler_SMP_Do_start_idle ->_Scheduler_SMP_Release_idle_thread .<br>
><br>
> I am asking this since _Scheduler_Set_idle_thread() is the only <br>
> function that sets the node->idle value.<br>
<br>
I think the description of this member is clear:<br>
<br>
/**<br>
* @brief Scheduler node for per-thread data.<br>
*/<br>
struct Scheduler_Node {<br>
...<br>
<br>
/**<br>
* @brief The idle thread claimed by this node in case the sticky <br>
level is<br>
* greater than zero and the thread is block or is scheduled on another<br>
* scheduler instance.<br>
*<br>
* This is necessary to ensure the priority ceiling protocols work across<br>
* scheduler boundaries.<br>
*/<br>
<br>
struct _Thread_Control *idle;<br>
<br>
As I said before, the idle threads are normal threads. The only special <br>
thing is that they execute no code which blocks. You really have to <br>
distinguish between threads and scheduler nodes.<br>
<br>
</blockquote></div>