[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua and multi-threaded FastCGI servers
- From: Javier Guerra <javier@...>
- Date: Thu, 3 Mar 2005 20:07:45 -0500
On Thursday 03 March 2005 7:42 pm, Peter Colson wrote:
> So the problem is that l_fcgiout() needs access to the FCGX_Request
> instance set up in the FastCGI accept loop (prior to calling Lua).
> What is the best way to make the FCGX_Request instance in the threaded
> accept loop available to my Lua function l_fcgiout?
> Should I:
> a). Push it onto the stack and pop it off in l_fcgiout (along with
> other parameters passed to fcgiout)?
> b). Use a Lua global variable since global variables are distinct for
> each Lua VM and each worker thread above creates it's own Lua VM?
> c). Use the Lua registry? Is the registry a per Lua VM entity like the
> global variables in b)?
i'd choose b)
have you tried LuaThreads? it'd let you do most of this in Lua, in fact i
think it could be a straightforward enhancement to the fastcgi launcher of
Description: PGP signature