[OT] poll() vs. AIO (was: [PATCH] ash: clear NONBLOCK flag from stdin when in foreground)

Laurent Bercot ska-dietlibc at skarnet.org
Thu Aug 18 19:56:52 UTC 2011


> No, that is just entrenching the polling methodology.
> I am a proponent of true AIO design, with _no_ polling
> facilities available at all.

 I understand what you mean, but poll() loops, despite the misleading
name of the central primitive, are not doing any polling at all. poll()
works by notification, not by polling (... at least I hope that kernel
developers have the good sense to make it so).

 Fully asynchronous poll() loops are event-driven programming (wait to
be notified of an event, take related action, rinse, repeat), just as
completion queues are. If you like DNIX's completion queues, there is
no reason you should dislike poll() loops, because it's the same paradigm;
the DNIX API probably just provides you with nice syntactic sugar to hide
the gory details of adding and removing events and/or timers.

 Other AIO paradigms mess with the program control flow. I personally
like having maximum control over the control flow, so I'm reluctant to
use such paradigms, but it's purely a question of taste.

-- 
 Laurent


More information about the busybox mailing list