Question about non-blocking notification
Hi, Do I need to use seL4-NBSend() for sending a non-blocking signal (cause seL4_Signal() is blocking)?
Hi!
You do not need to use seL4_NBSend() to send a signal without blocking.
The reason is that Notification objects - like all kernel-implemented
objects - complete their operation immediately. That doesn't mean that the
other thread will immediately receive the signal, only that the signal will
be recorded for processing and control will immediately be returned to your
thread.
NBSend only makes sense on Endpoints, where it prevents waiting for the
other thread to be in the receiving state.
On Sat, 31 Dec 2022 at 10:00,
Hi,
Do I need to use seL4-NBSend() for sending a non-blocking signal (cause seL4_Signal() is blocking)? _______________________________________________ Devel mailing list -- devel@sel4.systems To unsubscribe send an email to devel-leave@sel4.systems
-- William ML Leslie
On Sat, 31 Dec 2022 at 11:15, William ML Leslie < william.leslie.ttg@gmail.com> wrote: Notification objects - like all kernel-implemented objects - complete their operation immediately.
Or maybe put another way - notification objects are always ready to respond to your messages, so they do not block. -- William ML Leslie
On Sat, 31 Dec 2022 at 11:19, William ML Leslie < william.leslie.ttg@gmail.com> wrote:
On Sat, 31 Dec 2022 at 11:15, William ML Leslie <
william.leslie.ttg@gmail.com> wrote: Notification objects - like all kernel-implemented objects - complete their operation immediately.
Or maybe put another way - notification objects are always ready to respond to your messages, so they do not block.
I'm still technically wrong without further context, so let me clear up the two different usages of blocking here: The "blocking" in NBSend refers to waiting until the receiver can receive the message. A non-blocking send does not wait for the receiver to be ready to receive the message, if the receiver is not ready, it simply doesn't send the message. Signals are *always* "non-blocking", in that you can send one, regardless of what state the thread is in that will receive the Signal. However, when you send a Signal, you send a message to the Notification object, which is always ready to receive your message. So, you don't need to use a non-blocking system call to do the send. I hope that helps. -- William ML Leslie
Hi, So a sender seL4_Signal(ep) even before a receiver seL4_Wait(ep)? As seL4_Signal is non-blocking, the sender thread can proceed regardless of the receiver's state. The signal is also *recorded* such that the receiver can later receive the signal with seL4_Wait(). Am I correct?
participants (3)
-
mincheol@vt.edu
-
Nataliya Korovkina
-
William ML Leslie