Hi Charles,

On 11/26/2016 12:55 AM, Charles Cross wrote:
> Perhaps this is designed for the case where actions are taken inside the
> ISR which signal other threads (like sending IPC messages), but I'm
> still not clear on why it would need to reschedule the previously
> executing thread relative to other running or pending threads of equal
> priority.

Your analysis is correct, and you might have found a bug in the
scheduling logic. "sched_context_switch_request" is used by
"context-switch triggering" functions (sending a message, unblocking a
mutex), so after the ISR ends, the context switching code runs the
scheduler and then switches to the highest priority thread in pending state.
It should not advance the circular list of the current thread.
Threads in one priority level are supposed to be scheduled cooperatively.

So in essence, "thread_yield_higher()" should be called instead of
"thread_yield()".

I'll investigate some more and then probably fix this.

Thanks for digging this deep!

Kaspar
_______________________________________________
devel mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/devel

Reply via email to