[lkml]   [2001]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: aio
At 08:32 AM 20/12/2001 -0800, Dan Kegel wrote:
>Proper wrapper code can make them (almost) easy to program with.
>See for an example
>of a wrapper that automatically handles the fallback to poll() on overflow.
>Using this wrapper I wrote ftp clients and servers which use a thin wrapper
>api that lets the user choose from select, poll, /dev/poll, kqueue/kevent,
>and RT signals
>at runtime.

SIGIO sucks in the real-world for a few reasons right now, most of them
unrelated to 'sigio' itself:

1. SIGIO uses signals.
look at how signals are handled on multiprocessor (SMP) boxes.
can you say "cache ping-pong", not to mention the locking and
loop lookups?
every signal to user-space results in 512-bytes of memory-copy
from kernel-to-user-space.

2. SIGIO is very heavy
userspace only gets back one-event-per-system-call, thus you end
up with tens-of-
thousands of user<->kernel transitions per second eating up
valuable cpu resources.
there is neither: (a) aggregation of SIGIO events on a per-socket
basis, nor
(b) aggregating multiple SIGIO events from multiple sockets onto a
single system call.

3. enabling SIGIO is racy at socket-accept
multiple system calls are required to accept a connection on a
socket and then
enable SIGIO on it. packets can arrive in the meantime.
one can workaround this with a poll() but its bad.

4. in practical terms, SIGIO-based I/O isn't very good at expressing a
"no POLL_OUT" signal.

5. SIGIO is only a _notification_ mechanism. it does NOTHING for
zero-copy-i/o from/to-disk
from/to-userspace from/to-network.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:14    [W:0.066 / U:9.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site