lua-users home
lua-l archive

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


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
fast.

Anyway, thanks for your response -- and for your excellent work!

Regards,
Mike

On Tue, Feb 15, 2011 at 11:20 AM, Mike Pall <mikelu-1102@mike.de> 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.
>
> --Mike
>
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com