[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT + FFI -- + native threads?
- From: Michael Gogins <michael.gogins@...>
- Date: Tue, 15 Feb 2011 12:38:01 -0500
Callbacks could be kludged outside of FFI, I am sure. But I think I
will wait for callbacks in FFI, because I would indeed need them to be
Anyway, thanks for your response -- and for your excellent work!
On Tue, Feb 15, 2011 at 11:20 AM, Mike Pall <email@example.com> wrote:
> Michael Gogins wrote:
>> My question is this: Are there any plans to implement native threads
>> in LuaJIT?
> Well, in theory you can do this yourself with the LuaJIT FFI: it
> has full access to the thread APIs of the OS. Alas, callbacks are
> not implemented right now, which foils this attempt. This will be
> fixed eventually.
> Once that is done, you can just create a different Lua state from
> the FFI and run it in a different thread. I guess one would be
> able to get a first cut running in a couple minutes. But there are
> many challenges, like passing objects between separate Lua states
> and so on. I'm not sure this is something every developer needs to
> replicate or should try to get right on his/her own.
> So, yes, in the long term I want to provide a convenient API,
> which allows you to create new Lua states in different threads and
> communicate with them (e.g. a ffi.thread module). But I won't get
> around to do this anytime soon with my current workload.
Michael dot Gogins at gmail dot com