select() actually IS edge triggered
Posted Mar 14, 2003 14:08 UTC (Fri) by paulsheer
Parent article: Edge-triggered interfaces are too difficult?
Yes, select() for some devices IS edge triggered.
If select() marks a file descriptor available for
read/writeing (on some devices on some OS's) it WON'T mark
it again. You HAVE to read/write from it if you requested
for event notificatin for that file descriptor.
Therefore, in my select_tut man page (see recent
man page package from Linux doc), I make it clear
never to ask for event notification on a file
descriptor unless you intend to respond with a
read or write. Some devices work level triggered,
but programs that count on this may break.
The programs that do not use select() properly
should be fixed.
The whole point of the new system call (or it
ought to be the whole point) is that old select()
programs can simply #ifdef HAVE_EPOLL and get
the benefit or O(better) file descriptor event
handling -- with little or no other changes.
(This has nothing to do with what the standards
might say. Most programs are coded to run on
machines, not on standards :-)
to post comments)