Rn-readiness notification

Source: Internet
Author: User

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.