Curious about network connection events

Andrew R. Reiter arr at watson.org
Wed Mar 17 17:03:23 UTC 2004


On Tue, 16 Mar 2004, Roger Dingledine wrote:

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

Oops! I meant epoll not sysevq when I referred to linux; my mistake.

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

Ok, gotcha.  I am new to the 2nd gen. OR work so please excuse my
ignorance.  I will try to familiarize myself more ;)

: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. :)
:

*nod*; I'll look at what it'll take and you'll hear from me if I have it
done.

Cheers,
Andrew

--
Andrew R. Reiter
arr at watson.org
arr at FreeBSD.org



More information about the tor-dev mailing list