[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Advice on running and reusing multiple threaded Lua states
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 23 Mar 2012 13:43:01 -0300
> > 3) Instead of wrapping <user code> in the template function, could I just
> > push it
> > as a Lua chunk and pcall()-it ?
>
> usually yes, but it might be harder to get parameters. sometimes i
> add a callback to fetch values, so i don't need any parameter.
chunkwithparameters = "local x,y,z = ...; return x + y + z"
f = assert(load(chunkwithparameters))
print(f(3,4,5))
-- Roberto