lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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

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

--
Javier