kqueue examples?

Adrian Chadd adrian at freebsd.org
Mon Oct 23 06:21:08 UTC 2006

Hi all,

I'm currently fiddling with writing a 'simple' TCP proxy for FreeBSD
which uses kqueue to handle IO. I've been looking for examples of
kqueue code which uses all the cute features of kqueue to "optimise"
things, eg "hinting" at send/recv size, whether EOF has been seen,
setting the buffer low watermark for triggering, that kind of thing.

All I've found thus far (and I hope I'm not to blame for my initial
hackings of kqueue in a few bits of software!) are simple
level-triggered uses which don't seem much better than Linux epoll or
Solaris /dev/poll. Even libevent uses it pretty naively.

Has anyone come across some network software which uses kqueue
"differently" to the above ?



Adrian Chadd - adrian at freebsd.org

More information about the freebsd-performance mailing list