Curious about network connection events

Roger Dingledine arma at
Wed Mar 17 04:40:36 UTC 2004

On Tue, Mar 16, 2004 at 07:34:00PM -0500, Andrew R. Reiter wrote:
> I am curious about if there has been any thought to expanding the
> connection interface to not just use poll(2) or select(2) but allow for
> more recent APIs such as kqueue in BSD and sysevq in linux.  Doing this by
> a generic interface such as Libevent from Niels Provos might be an easy
> way to do this... perhaps (not saying it's the right way).

Right now we use poll (or if poll is not available or buggy, we have
our own simple poll wrapper that uses select), and it works fine for us.

I anticipate that if we start getting 1000 or more sockets we care
about, then we will want something better. I hear epoll is an easy
drop-in replacement, though not available on some backward systems. ;)
But really, when we get to that point, we'll figure out what we need and
what's available at that point.

Consider 100 servers and 10000 users: each server is connected to the
other 100, and has another 100 users clustered around him. So I don't
think poll is a bottleneck for us right now, and won't be for the next
quite a while.

But that said, if you wanted to refactor main.c so it's more flexible (but
still clean) with its event handling, we'd probably accept the patch. :)


More information about the tor-dev mailing list