Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Sep 2021 11:20:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 258310] kevent() does not see signal with zero timeout
Message-ID:  <bug-258310-227-dJ6byTqe7r@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-258310-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258310

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. 
It
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.

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258310-227-dJ6byTqe7r>