Hello, On 2023-12-05 11:40, chenpingyuan--- via Devel wrote:
Thanks Indan for your detail reply. By ready queue, I did mean the scheduling queue since the code named it as ksReadyQueues.
Oh, good, I wasn't sure any more.
For threads unbound from a SC, this thread will be removed from both ksReadyQueues and ksReleaseHead according the code below: void schedContext_unbindTCB(sched_context_t *sc, tcb_t *tcb)
Yes, schedContext_unbindTCB() does that, but schedContext_unbind() doesn't. It looks like it works okay, in that if a thread with no SC gets unblocked by a signal, it is removed from the notification queue and put in active state, and not actually ran or added to any scheduler queues by accident.
But for threads which are blocked at waiting for a signal/message, according to your reply and the code, my current understanding is that: Those threads which are in ThreadState_BlockedOnNotification(for example) will be in neither ksReadyQueues nor ksReleaseHead, and these threads will be either notification's queue or endpoint's queue which saves the blocked TCBs.
Am I right now?
Yes. Greetings, Indan