Re: aio

Linus Torvalds (torvalds@transmeta.com)
Thu, 20 Dec 2001 13:59:40 -0800 (PST)


On Thu, 20 Dec 2001, Lincoln Dale wrote:
>
> SIGIO sucks in the real-world for a few reasons right now, most of them
> unrelated to 'sigio' itself:

Well, there _is_ one big one, which definitely is fundamentally related to
sigio itself:

sigio is an asynchronous event programming model.

And let's face it, asynchronous programming models suck. They inherently
require that you handle various race conditions etc, and have extra
locking.

Note that "asynchronous programming model" is not the same as
"asynchronous IO completion". The former implies a threaded user space,
the latter implies threaded kernel IO.

And let's face it - threading is _hard_ to get right. People just don't
think well about asynchronous events.

It's much easier to have a synchronous interface to the asynchronous IO,
ie one where you do not have to worry about events happening "at the same
time".

SIGIO just isn't very nice. It's useful for some event notification (ie if
you don't actually _do_ anything in the signal handler), but let's be
honest: it's an extremely heavy notifier. Something synchronous like
"poll" or "select" will beat it just about every time (yes, they don't
scale well, but neither does SIGIO).

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/