On 21/08/2020 11:34, Richi Dubey wrote:
_SMP_Preempt calls _Thread_Dispatch_update_heir which
calls _Thread_Dispatch_request which sends an interrupt
with _CPU_SMP_Send_interrupt.
Yes.
This interrupt would have set the executing equal to heir but would've
taken unpredictable time,
Yes, this is how it works. The scheduler asks for a thread dispatch, but
when it takes place is out of the control of the scheduler.
but explicitly calling _Thread_Dispatch_enable(other_cpu) right after
_SMP_Preempt(...node_on_other_cpu...) sets the executing corresponding
to the other_cpu's cpu control right away, is that correct?
No, this would be completely wrong. You should never call
_Thread_Dispatch_enable(other_cpu) and you should never modify the
thread dispatch level inside the scheduler code. The only thing you can
do is to update the heir and send requests via an inter-processor interrupt.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel