<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div>I see _Scheduler_priority_Ready_queue_enqueue calls _Chain_Append_unprotected</div><div>which has an interesting comment</div><div><div> * @note It does NOT disable interrupts to ensure the atomicity of the</div><div> *       append operation.</div></div><div><br></div><div>Catalin</div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 22, 2018 at 4:08 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 22/10/2018 15:00, Catalin Demergian wrote:<br>
> I started to look in the ready queues implementation. I added a debug <br>
> patch tracing my tasks having priority=100.<br>
> The way I see it, a task can enter a ready queue only <br>
> with _Scheduler_priority_Ready_queue_enqueue/_Scheduler_priority_Ready_queue_enqueue_first<br>
> and can be removed only by _Scheduler_priority_Ready_queue_extract.<br>
<br>
Yes.<br>
<br>
> I logged what rtems_clock_get_ticks_since_boot returns for every task <br>
> and what I found was that for SCrx task this value is way behind the <br>
> value for<br>
> other tasks, meaning after a point is not added in the ready queue <br>
> anymore.<br>
> I tried with debugger too, following the next pointers to see what's <br>
> in the ready_queue[100] and my task is not there, even if I see the <br>
> state is ready<br>
> when doing task command in shell.<br>
> any idea what might be causing this?<br>
<br>
The thread state is Thread_Control::current_state, the code sequences to <br>
block/unblock a thread should take care that ready threads <br>
(current_state == 0) are visible to the scheduler (enqueued). Something <br>
might have gone wrong during a non-ready to ready thread state transition.<br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : +49 89 189 47 41-16<br>
Fax     : +49 89 189 47 41-09<br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</blockquote></div>