Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2013 09:19:01 +0100
From:      Sebastian Huber <sebastian.huber@embedded-brains.de>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Purpose of kqueue_task?
Message-ID:  <5146CDF5.3070308@embedded-brains.de>
In-Reply-To: <CAFMmRNxbYpavy1XDuPYP--dZ57ifTZqC=PDBS%2Bv%2Bjx1KR0OrMw@mail.gmail.com>
References:  <51435063.7050907@embedded-brains.de> <CAFMmRNxbYpavy1XDuPYP--dZ57ifTZqC=PDBS%2Bv%2Bjx1KR0OrMw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/15/2013 06:19 PM, Ryan Stone wrote:
> On Fri, Mar 15, 2013 at 12:46 PM, Sebastian Huber
> <sebastian.huber@embedded-brains.de
> <mailto:sebastian.huber@embedded-brains.de>> wrote:
>
>     Hello,
>
>     I want to port the FreeBSD kqueue implementation to another operating
>     system (RTEMS in this case) to improve the Erlang support.
>
>     I have difficulties to understand the purpose of the kqueue_task.  This
>     function runs asynchronously.  It obtains some locks and wakes up the
>     normal kqueue channel if (kq->kq_state & KQ_TASKDRAIN) == KQ_TASKDRAIN.
>       This state is only set in kqueue_close().  So most of the time the
>     kqueue_task only obtains some locks, clears a flag (KQ_TASKSCHED) and
>     releases the locks?
>
>
> You missed the most important thing that it does: it calls KNOTE_LOCKED to wake
> up any waiters sleeping on this event.  I suspect that it had to be done in a
> separate task due to lock ordering problems with the kq_global lock.

Oh, I was blind.  This KNOTE_LOCKED looked more like an assertion to me.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5146CDF5.3070308>