rn - readiness notification

rn - readiness notification

rn - readiness notification

Contents

The Problem: Efficient I/O multiplexing calls not yet standardized

Unix offers two system calls, 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 calls 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 calls, 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 abstraction 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 could 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

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.a.

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]
posted on 2013-03-29 09:42  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2013/03/29/2988260.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值