Subject: Re: gethostbyname_r() ?
To: None <tech-net@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-net
Date: 07/17/2006 18:39:20
On Mon, 17 Jul 2006, Thomas E. Spanjaard wrote:
> If Tor soups up that many threads cq. processes, it sounds like a very
> wrong design decision, they should use an event loop instead. So the
> 'upgrade to a better OS' is completely out of line.

They do use an event loop.  But some operations can take a long time, so
Tor offloads those operations to helper threads (or helper processes),
with the main event loop using non-blocking IO over pipes to communicate
with the helpers.  Tor uses CPU helpers to deal with crypto operations
that may take a long time, and DNS helpers to deal with DNS lookups that
will almost always block.

--apb (Alan Barrett)