Rn-readiness notification
Rn-readiness notificationcontents
- The problem: Efficient I/O multiplexing cballs not yet standardized
- One solution: a thin wrapper around epoll et al
- Downloading Rn
- Installing Rn
- Using Rn
The problem: Efficient I/O multiplexing cballs not yet standardized
UNIX offers two system CILS, select () and Poll (), which accept a list of file descriptors, block until one of the set is ready for I/O, and return a list of the ready file descriptors. the time to execute these CILS is proportional to the number of file descriptors, which means they become inefficient above a couple thousand file descriptors.
Various implementations of UNIX offer high-performance, scalable replacements for these system CILS, e.g. kqueue (),/dev/epoll, and Linux's realtime signal readiness notification, all with significantly different interfaces. this makes them difficult to learn, and makes it hard to write portable code.
(See the c10k problem for more about the problem .)
One solution: a thin wrapper around epoll et al
RN is a tiny lightweight library written in C, licensed under the lgpl, that provides a common wait action for several readiness notification schemes. it is significantly easier to use then sigio, and about as easy to use as kqueue, epoll, And the edge-triggered variant of sys_epoll.
New readiness notification schemes can easily be supported by writing a new "subclass" of RN.
It currently only supports edge-triggered readiness notification schemes. it cocould easily be used with level-triggered schemes, but IMHO edge-triggered readiness notification is more convenient when you get used to it, and has slightly less CPU overhead.
Downloading Rn
- Tarball: kegel.com/rn/rn-0.4.tar.gz
- Individual files: kegel.com/rn/current/
Installing Rn
To install RN, do the usual
$ Tar-xzvf rn-0.4.tar.gz $ CD rn-0.4 $./configure $ make $ su # make install
This will install rn. h and librn..
Using Rn
The API is fairly simple; see rn.html for documentation, and rn_test.c for an example.
Last change: 15 Oct 2003
Portions Copyright 2002 Dan Kegel
Portions Copyright 2003 ixia communications
Licensed under the lgpl
[Return to kegel.com]