[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Luarocks-developers] [ANN] lua-llthreads 1.0
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Mon, 11 Apr 2011 23:13:36 -0700
On Sunday 10, joshua simmons wrote:
> Cool benchmarks. Cool release.
Thanks, and thank you for coming up with name ideas for the project.
> I'll have to have a play some time.
When you have some time and if you are interested I have an idea on how to add
thread support to your mongrel2 lua handler. Basically the main thread would
act as the request load balancer and spawn X child threads to run the handler
code. The balancer thread would pull requests from mongrel2 and push then to
the child handlers. The child handlers would be able to send responses
directly back to mongrel2 without having to route them back through the
balancer thread. For "chat server" like handlers they would need to have a
way to share messages between the child handlers, this shouldn't be to hard to
do but would require the handler to be multi-thread aware.
For handlers that don't need or want to be multi-thread, they could work like
normal and run in the main thread (i.e. without the extra balancer hop for
requests).
--
Robert G. Jakabosky