Hello, On 2023-12-05 01:47, chenpingyuan--- via Devel wrote:
By saying " threads that are blocked waiting in an endpoint or notification queue will remain in the queue and can still recieve messages and signals.", does it mean that those threads blocked waiting in an endpoint or notification queue will remain in the READY QUEUE? Or maybe the manual was not accurate?
The manual is accurate, but it does not document the scheduling queues in detail, like the ready queue (called "scheduling queue" in the manual) or the release queue (queue of threads waiting for more budget, not to be confused with "replenishment queue", which each scheduling context has and doesn't queue threads, but budget refills). It does document the end point queue though in chapter 4.2. Notifications also have a queue which isn't clearly described, but it is very similar to end points, as mentioned in 6.1.7. Every end point and notification object have a queue where threads that block on them will be queued on. All threads can only be in one queue at the time, either one of the scheduling ones, or an end point or notification queue. Because of this it is not possible to wait for multiple end points or notifications at the same time. The only exception is waiting for an end point and a bound notification at the same time, as the end point code does extra checking for bound notifications. For details like these you have to read the seL4 source code, though higher levels things can be hard to extract from the source. Maybe you confused me with "ready queue", as that is the name in the source code for the scheduling queue for active threads, but perhaps you meant the EP/NF queues instead. If that's the case, to perhaps answer your actual previous question: Yes, threads which are blocked waiting for notification/endpoint without schedule context will remain in the object's queue. This is possible because when they unblock, they will get a scheduling context, and this is also the only way to unblock them, so they don't need to be queued anywhere else. For end points the caller's SC will be donated, for notifications the bound SC will be used. However, I don't know what happens if a scheduling context disappears because of a call to seL4_SchedContext_Unbind() and there is no SC bound to the NF (any more). I would the expect the behaviour to be the same as when the thread gets suspended, however, seL4_TCB_Suspend() will call cancelIPC(), but that doesn't seem to happen for seL4_SchedContext_Unbind(). Greetings, Indan