[libdispatch-dev] [PATCH 00/17] portability + chainsaw

Paolo Bonzini bonzini at gnu.org
Sun Oct 18 08:04:00 PDT 2009

Here is my attempt at improving libdispatch's portability.  Of course
it's still a kevent-only show, but it should be easier now to implement
an epoll-based (or even SIGIO+SIGALRM+poll-based) replacement.  At least
it makes more clear where the boundaries are between the kevent code
and the rest.

Because of the very precise requirements of libdispatch on kevent's
semantics, it may be easier to go this way rather than implement kevent
as a wrapper.  I have no answer, and libnqkqueue is very interesting,
but anyway these patches are quite safe.

Here are them:

- add .gitignore files
- move __private_extern__ detection to an autoconf macro
- move atomic builtin detections to separate autoconf macro
- move blocks detection to separate autoconf macro
- more precise detection of blocks

Just configury.

- split os_shims.h into separate files
- remove compat/fd_copy.h
- finish moving stuff into src/shims

Unifying a bit the terminology, see individual comments.

- portability

After which the non-kqueue parts compile on Linux.

- consolidate hashing of dispatch_kevent_t
- move mach2nano/nano2mach from source.c to shims/

Two small cleanups.

- extract source-type-specific initialization to per-type functions

More completely developed later in the series.

- abstract some mentions of ds->ds_dkev

Also preparing for later.

- extract kevent-specific parts of queue.c
- almost completely separate kevent/source.c

Moving code to new files without any change.  You can check this
with a command like

diff -b <(git diff HEAD^^^! src/source.c | sed -n s/^-//p)
        <(git diff HEAD^^^! src/source_kevent.c | sed -n s/^+//p)

- complete separation
- remove last mention of struct kevent from "generic" code

These finish the cleanup.

Note: this was tested on FreeBSD only.



More information about the libdispatch-dev mailing list