Hi,

I am debugging a code (tm24
<https://git.rtems.org/rtems/tree/testsuites/tmtests/tm24/task1.c>) and
there is a scenario where a thread is blocked on the CPU and a new thread
has to start executing in its place. So, the thread which is getting
blocked (executing thread) executes the _Thread_Do_dispatch and runs the
code until
<https://git.rtems.org/rtems/tree/cpukit/score/src/threaddispatch.c#n308>:
_Context_Switch( &executing->Registers, &heir->Registers ). After this, the
heir thread starts executing from _Thread_Handler. Why is this the case?
Should the heir not start its execution from where the (earlier) executing
thread left the program counter at, i.e. after the _Context_Switch in
_Thread_Do_dispatch?

Please let me know your thoughts.

Thanks,
Richi.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to