[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A question about event driven paradigm and helper/worker thread
- From: Javier Guerra Giraldez <javier@...>
- Date: Wed, 15 Aug 2007 06:42:54 -0500
gary ng wrote:
The problem though is, with such a design and I have
say 10K connections, I need 10K helper threads which
totally negate the advantage of the orginal event
driven design, where each coroutine takes only about
20K(for a hello world type response) vs 1M for an OS
A modification of it would be to have a pool of helper
threads and find the free one and use it, then spawn
new ones if all are occupied.
HTT does (most) of this for you.
you create as many helper threds as you want, and all that share the
same input queue colaborate on handling the tasks you put there.
the included scheduler uses this to separate the creation of helper
threads and lua 'threads'.