<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 2, 2019, 12:03 AM  <<a href="mailto:mbenson@windhoverlabs.com">mbenson@windhoverlabs.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">That’s kind of my point.  The low priority shell task is working perfectly.  The higher priority task is pended by time.  I do have some sleep functions in the driver code but they are short sleeps.  They shouldn’t just pens indefinitely until a run any random command in the shell.  Unless I’m not understanding the priority model correctly and have inadvertently inverted my prioritities.<br></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The shell has to be the executing task to run the command and produce output. It is only running when nothing else is running in your system. But the reports will never catch another task ready because if it was ready, the scheduler would pick it to be the executing thread.</div><div dir="auto"><br></div><div dir="auto">It looks and sounds odd but it is exactly what is supposed to happen. It's lowest priority and produces output when it runs. </div><div dir="auto"><br></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 dir="auto"><br><div id="m_-5594116906315117215AppleMailSignature" dir="ltr">Sent from my iPhone</div><div dir="ltr"><br>On Nov 1, 2019, at 14:40, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank" rel="noreferrer">joel@rtems.org</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 1, 2019 at 12:33 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</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"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 1, 2019 at 10:52 AM Mathew Benson <<a href="mailto:mbenson@windhoverlabs.com" target="_blank" rel="noreferrer">mbenson@windhoverlabs.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">So no matter what priority the shell task is initialized as, it preempts all other tasks?  <br></div><br></blockquote><div>No.</div></div></div></blockquote><div><br></div><div>But an odd artifact of looking at the status of threads in the shell is that the shell thread has to be **EXECUTING** to do that. Since this is a single core system, it means all other threads are either blocked or ready and have a lower priority.</div><div> </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 class="gmail_quote"><div><br></div><div>With low priority (250) under the default scheduling (fixed priority round-robin), the shell would only run when higher priority tasks are blocked. This is typical, and the shell will be preempted when higher priority tasks are made ready. The "TIME" state indicates your driver task self-suspended on a timer, e.g., nanosleep or wake_after type call. It should preempt the shell after the timeout. If it isn't then something is going strangely.</div></div></div></blockquote><div><br></div><div>Yep. </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 class="gmail_quote"><div><br></div><div>As Joel hinted, if you're using POSIX threads, then 250 is higher priority than 235.</div></div></div></blockquote><div><br></div><div>But I don't know how this is reported by the command he is using. I recall one command to list Classic API tasks and one for POSIX threads. I don't recall one which lists all but I could be wrong.</div><div><br></div><div>--joel</div><div> </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 class="gmail_quote"><div><br></div><div>Gedare</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 1, 2019 at 11:36 AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank" rel="noreferrer">joel@rtems.org</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="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 1, 2019, 11:24 AM Mathew Benson <<a href="mailto:mbenson@windhoverlabs.com" target="_blank" rel="noreferrer">mbenson@windhoverlabs.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">My shell task is set to priority 250.  I have another task that I've set to a priority of 235.  When I have the shell in the build, that priority 235 task appears to pend indefinitely with the shell reporting state = "TIME" and I don't know where it would be pending.  The task is accessing NOR drivers.  But just by running the shell command, releases that priority 235 task.  In fact, any command releases it.  Whether its a valid command or not.  But if I remove the shell from the build, everything is fine.  The task doesn't pend.  It executes as it should.  Did I miss something in the documentation regarding integration of the shell?  Is there something we are or are not supposed to do when the shell is integrated? <br clear="all"></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I'm off today and this is from my phone. </div><div dir="auto"><br></div><div dir="auto">TIME should indicate that the task is sleeping. Assuming these are not POSIX thread priority The priority 235 task has to be blocked or the shell task won't run at all. So anytime your shell task runs, the others should be blocked.</div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><div class="gmail_quote"><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><div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div><div><b>Mathew Benson</b><br></div>CEO | Chief Engineer<br></div>Windhover Labs, LLC<br>832-640-4018<br><br><img src="https://drive.google.com/a/windhoverlabs.com/uc?id=1cLDczWESrU667xKgEJlFhHa2yjq5UVhJ&export=download"><br></div><a href="http://www.windhoverlabs.com" rel="noreferrer noreferrer" target="_blank">www.windhoverlabs.com</a><br><br></div></div></div></div></div></div></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" rel="noreferrer noreferrer" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div><div><b>Mathew Benson</b><br></div>CEO | Chief Engineer<br></div>Windhover Labs, LLC<br>832-640-4018<br><br><img src="https://drive.google.com/a/windhoverlabs.com/uc?id=1cLDczWESrU667xKgEJlFhHa2yjq5UVhJ&export=download"><br></div><a href="http://www.windhoverlabs.com" target="_blank" rel="noreferrer">www.windhoverlabs.com</a><br><br></div></div></div></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>
</blockquote></div></div>
</div></blockquote></div></blockquote></div></div></div>