Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Waking up all threads waiting in kevent

1 view
Skip to first unread message

Christof Meerwald

unread,
Jul 26, 2015, 1:57:59 AM7/26/15
to
Hi,

I have got multiple threads waiting on a single kqueue and want to
wake up all these threads at some point (before exiting). I believe
the way to do it is to have a dummy socket/pipe added to the kqueue
and close the other end (I have also found
http://thread.gmane.org/gmane.os.netbsd.devel.kernel/28051 which seems
to agree on that approach).

But when I am actually testing this approach, some threads don't seem
to be woken up and keep waiting in the kevent syscall. Source code for
a test case is available from
http://svn.cmeerw.net/src/nginetd/trunk/test/kqtest-wakeup.cc

I have tested on my ODROID-C1 (quad core ARMv7) with netbsd-7 (build
from a few days ago) and seen the problem occur with 3 or more
threads.

Is there a problem in my test case, is it a kernel bug or an
ODROID-C1/ARM specific issue? Any ideas?


Christof

--

http://cmeerw.org sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

Taylor R Campbell

unread,
Jul 26, 2015, 1:58:14 PM7/26/15
to
Date: Sat, 25 Jul 2015 18:23:52 +0200
From: Christof Meerwald <cme...@cmeerw.org>

Is there a problem in my test case, is it a kernel bug or an
ODROID-C1/ARM specific issue? Any ideas?

I can reproduce it in netbsd-6 on x86, once every four trials or so
with 16 threads. Sounds like a race leading to a missing wakeup
somewhere in kqueue. Can't reproduce it with poll instead of kqueue.
Can you please file a PR?
0 new messages