<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 14, 2021 at 12:30 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">Hi,<br><div><br></div><div>In the <a href="https://git.rtems.org/rtems/tree/testsuites/tmtests/tm24/task1.c#n106" target="_blank">Tasks function</a>, when one of the OPERATION_COUNT thread calls <span style="color:rgb(0,0,0);font-size:13.3333px">rtems_task_wake_after(</span>RTEMS_YIELD_PROCESSOR<span style="color:rgb(0,0,0);font-size:13.3333px">), it yields the processor and <a href="https://docs.rtems.org/releases/rtemsdocs-4.6.2/share/rtems/html/c_user/c_user00077.html" target="_blank">goes</a> in the ready state. So, is it expected that the same thread gets the execution again after the call to </span><span style="color:rgb(0,0,0);font-size:13.3333px">rtems_task_wake_after(</span>RTEMS_YIELD_PROCESSOR<span style="color:rgb(0,0,0);font-size:13.3333px">)? - because it is one of the threads with the highest priority and is in the ready queue - like call <a href="https://git.rtems.org/rtems/tree/testsuites/tmtests/tm24/task1.c#n90" target="_blank">to</a> rtems_task_wake_after in the High_task function?</span></div></div></blockquote><div><br></div><div>I think you have missed this piece of code in the test:<br><br>status = rtems_task_create(<br>      rtems_build_name( 'R', 'E', 'S', 'T' ),<br>      (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u,<br><br></div><div> Init and High_Task have priority 1 and all the REST have lower priorities with every REST thread having a unique priority.</div><div><br></div><div>The test should execute </div><div><br></div><div>Init </div><div>High </div><div>  - benchmark yield which returns to the same thread</div><div>  - start time</div><div>  - rtems_task_exit</div><div>Rest(pri=2) </div><div>   - rtems_task_exit</div><div>.... more Rest threads</div><div>Rest(pri=lowest based on operation count)</div><div>    there is an if which checks that operation_count says to stop)</div><div>    end timer</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"><div><span style="color:rgb(0,0,0);font-size:13.3333px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:13.3333px">If yes, the thread finishes its execution after the call to rtems_task_wake_after and the function also ends, does RTEMS try to find the next heir to execute?</span></div></div></blockquote><div><br></div><div>rtems_task_wake_after(yield) in High should return. There are no other threads at priority 1 and the REST should have no impact. They are all lower priority.</div><div><br></div><div>The other yield cases are when the caller is not preemptible and that is keeping higher priority threads from running. And when there are multiple threads at the same priority.</div><div><br></div><div>Both of those are more complicated than this where there is nothing else at this priority.</div><div><br></div><div>As I write this, I find it strange that you have issues with this test and not one of the sptests which should be setting up the same situation.</div><div><br></div><div>--joel</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"><div><span style="color:rgb(0,0,0);font-size:13.3333px">     </span><span style="color:rgb(0,0,0);font-size:13.3333px">   </span><br></div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>