TOC
Previous
Next
The epoll API
Problems with Signal-driven I/O
-
similar performance to epoll, but...
-
Achieving full performance
benefit requires Linux-specific feature,
fcntl(F_SETSIG), to select a real-time
signal for notification.
-
ues a queable real-time signal
-
siginfo_t
argument passed to handler tells
us which file descriptor is ready, and what event occurred.
(i.e., requires non-portable extensions
-- just as with epoll.).
-
Dealing with signals
is unnecessarily complex:
-
Signal handlers:
must take care of race conditions,
reentrancy issues, etc.
-
Accepting signals synchronously
(sigwaitinfo()):
signal queue overflow.
-
Signals and threads do
not mix well.
-
Blunt instrument --
can't choose what kind of
events to monitor
(e.g., "read possible"
versus "write possible").
(C) 2006, Michael Kerrisk