<div dir="ltr">Also,<div><br></div><div>The stack trace for the thread looks like this:</div><div><br></div><div>Tasks (entry function) -> rtems_task_wake_after ->_Thread_Dispatch_direct -> _Thread_Do_dispatch (where the _Context_switch function call lies), how can then the heir thread start executing from the _Thread_Handler? I do not see it in the trace at all.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 5, 2020 at 11:05 AM Richi Dubey <<a href="mailto:richidubey@gmail.com">richidubey@gmail.com</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"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have currently no time to help you debugging this issue.</blockquote><div>Okay, even a hint would be helpful.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">returns to _Thread_Do_dispatch() or jumps to _Thread_Handler(). </blockquote><div>When does it return to _Thread_Do_dispatch() and when does it jump to _Thread_Handler() ? Is there a condition? How does it choose between what to do? </div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 1:35 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">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 04/12/2020 08:56, Richi Dubey wrote:<br>
<br>
><br>
> When I am trying to debug tm24 running on the Strong APA scheduler <br>
> code, I can see that the thread which comes after the call <br>
> to _CPU_Context_switch, resumes execution from the same code (next <br>
> line in the _Thread_Do_dispatch function after _CPU_Context_switch), <br>
> whereas when the same code is run on a different scheduler (the <br>
> default sp scheduler) the heir thread that executes after the call <br>
> to _CPU_Context_switch starts executing from _Thread_Handler and does <br>
> not resume its execution from the _Thread_Do_dispatch (which has the <br>
> context_switch function call).<br>
><br>
> Why is this happening? Is the scheduler responsible for this?<br>
<br>
I have currently no time to help you debugging this issue.<br>
<br>
Each thread starts the execution in _Thread_Handler(). A context switch <br>
returns to _Thread_Do_dispatch() or jumps to _Thread_Handler(). The <br>
_Thread_Handler() completes the context switch, does some general calls <br>
to begin the thread execution and then calls the thread entry function.<br>
<br>
-- <br>
embedded brains GmbH<br>
Herr Sebastian HUBER<br>
Dornierstr. 4<br>
82178 Puchheim<br>
Germany<br>
email: <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
phone: +49-89-18 94 741 - 16<br>
fax: +49-89-18 94 741 - 08<br>
<br>
Registergericht: Amtsgericht München<br>
Registernummer: HRB 157899<br>
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler<br>
Unsere Datenschutzerklärung finden Sie hier:<br>
<a href="https://embedded-brains.de/datenschutzerklaerung/" rel="noreferrer" target="_blank">https://embedded-brains.de/datenschutzerklaerung/</a><br>
<br>
</blockquote></div>
</blockquote></div>