lua-users home
lua-l archive

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


On Mon, May 16, 2005 at 09:46:35PM -0500, Javier Guerra wrote:
> >2) Would be difficult to implement an async request? e.g.: A very slow 
> >request - like a database query returning many records - yelding 
> >periodically to not block other requests.
> 
> that's far more difficult.  the first versions of luahttpd used 
...
> when Andre showed me Copas, i decided to move luahttpd to run with it, 
> eventually that became the main Xavante project.  I designed (and even 
> managed to make it work) a weird 'thread under coroutine' that let any 
> handler to spawn a new preemptive thread when needed, but I couldn't 
> make i stable enough.  I think there's an issue with LuaThreads, 
> especially between different versions of the Lua core.

For requests expected to be "very slow",
one might also consider "heavy weight threads" a.k.a. processes.
On current unixes, fork is not that expensive (see e.g. fnord webserver).
For win, things are much more difficult, but alas ...

cheers