<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020, 10:14 AM Fernando Domínguez Pousa <<a href="mailto:fdpousa@gmv.com">fdpousa@gmv.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="ES" link="#0563C1" vlink="#954F72">
<div class="m_-7767105981103966958WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I am executing a program which executes four different task with testing operations. These tasks were created and launched in this way:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">status = rtems_task_create(Task_name[i], (rtems_task_priority) 2, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">            (i%2) == 0 ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES, &Task_id[i]);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">status = rtems_task_start(Task_id[i], (i%2) == 0 ? Task1_EntryPoint : Task2_EntryPoint, i);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">As you can see all task are created with the same priority, and launched one after the other inside a for loop. They are configured in default modes, so time slicing is disabled by default  (all mode bits are 0). This
 result would be expected due to each task would run-to-completion because all tasks have the same priority:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The expected result:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[MAIN] Waiting for testing tasks to complete...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 0] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 0] Computed the correct floating point result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 1] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 1] Computed the correct integer result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 2] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 2] Computed the correct floating point result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 3] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 3] Computed the correct integer result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[MAIN] All testing tasks completed.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Nevertheless, using RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_MODES | RTEMS_TIMESLICE or RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT either as rtems_mode, the result is always the same.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The actual result:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[MAIN] Waiting for testing tasks to complete...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 0] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 1] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 2] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 3] Starting...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 0] Computed the correct floating point result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 1] Computed the correct integer result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 2] Computed the correct floating point result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[TASK 3] Computed the correct integer result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[MAIN] All testing tasks completed.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">At RTEMS API Guide:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">The timeslicing component is used by the RTEMS scheduler to determine how the processor is allocated to tasks of equal priority. If timeslicing is
 enabled (</span><span class="m_-7767105981103966958pre"><span lang="EN-GB" style="font-family:Consolas;color:#2a8e1d;border:none windowtext 1.0pt;padding:0cm;background:#fcfcfc">RTEMS_TIMESLICE</span></span><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">),
 then RTEMS will limit the amount of time the task can execute before the processor is allocated to another ready task of equal priority.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">The length of the timeslice is application dependent and specified in the Configuration Table. If timeslicing is disabled (</span></b><span class="m_-7767105981103966958pre"><b><span lang="EN-GB" style="font-family:Consolas;color:#2a8e1d;border:none windowtext 1.0pt;padding:0cm;background:#fcfcfc">RTEMS_NO_TIMESLICE</span></b></span><b><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">),
 then the task will be allowed to execute until a task of higher priority is made ready.
</span></b><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">However I have not any task with higher priority, Init task priority is lower.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc">If </span><span class="m_-7767105981103966958pre"><span lang="EN-GB" style="font-family:Consolas;color:#2a8e1d;border:none windowtext 1.0pt;padding:0cm;background:#fcfcfc">RTEMS_NO_PREEMPT</span></span><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc"> is
 selected, then the timeslicing component is ignored by the scheduler.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#404040;background:#fcfcfc"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">How can I execute this tasks in a run to completion fashion for same priority tasks? Task 0 starts and ends, then Task1 starts and ends… etc,</span></p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">There are many things that could be happening. Can you post the program?</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="ES" link="#0563C1" vlink="#954F72"><div class="m_-7767105981103966958WordSection1"><p class="MsoNormal"><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Fer.</span><span lang="EN-GB">
</span><span><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<span><br>
</span><span style="font-size:18.0pt;line-height:125%;font-family:Webdings;color:green">P<span></span>
<span style="font-size:7.0pt;line-height:125%;font-family:"Arial","sans-serif";color:green">
Please consider the environment before printing this e-mail.</span></span><span></span>
</div>

_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank" rel="noreferrer">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div></div>