[libdispatch-dev] [PATCH 00/17] portability + chainsaw
bonzini at gnu.org
Mon Oct 19 00:08:26 PDT 2009
On 10/19/2009 04:52 AM, Mark Heily wrote:
> The benefits of using a wrapper library to emulate kqueue/kevent is that
> you don't have to make any major modifications to libdispatch. All you
> need to do is add -lkqueue to LDFLAGS, add -I/usr/include/kqueue to
> CFLAGS, and you're done. I sent a patch earlier to this effect.
I agree with that. libkqueue is a great short-term solution and
probably good even in the long-term. I have no crystal ball to say
that; my doubts come from having tried to implement poll(2) and
select(2) under Windows for a long time in a project of mine, and then
realizing that it is basically impossible, but in this case we're
talking of two Unices, so in general it is an easier task.
Still, trying to use sys/event.h in as few places as possible is good
anyway in my opinion; in fact, the ease with which I could do that shows
that the separation was even almost there in the design already! This
is a nice testimony to the great design of libdispatch.
I may try to implement the required signalfd semantics in the Linux
kernel, or at least something related (e.g. a "block signal on all
threads" system call).
More information about the libdispatch-dev