[Bug 258310] kevent() does not see signal with zero timeout

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 06 Sep 2021 11:20:31 UTC

Konstantin Belousov <kib@FreeBSD.org> changed:

           What    |Removed                     |Added
                 CC|                            |kib@FreeBSD.org

--- Comment #1 from Konstantin Belousov <kib@FreeBSD.org> ---
So the problem is actually not that kevent does not get signal notification. 
is that kqueue attached to kqueue with the signal event suddenly reports no
events when you specify zero timeout, i.e. non-blocking peek.  Am I right?

This is because kqueue subsystem has to fight with the recursion and deadlock.
If kqueue has another kqueue attached to it, then notification of the attached
kqueue is delegated to a task.  See knote_enqueue()->kqueue_wakeup()->
kqueue_schedtask().  Until task run, kq->kq_count == 0 and this together
with timespec being 0 (AKA unset) causes kqueue_scan() to immediately return 0.

I am not sure if this is worth complications to make the wakeup synchronous.

You are receiving this mail because:
You are the assignee for the bug.