[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Different behavior for coroutines in Lua and LuaJIT
- From: Mike Pall <mikelu-0806@...>
- Date: Mon, 16 Jun 2008 13:03:15 +0200
Yura Sokolov wrote:
> Mike Pall wrote:
>> If you want to create Lua threads from C (not recommended, it's not
>> faster), you need to read this: http://luajit.org/coco_api.html
>> Scroll down to lua_newcthread().
> Isn't luajit aimed to be binary compatible for libraries?
> In this case it is wrong behaviour (IMHO).
Well, CoCo is also a standalone patchset with minimal dependencies
on the Lua core. Oh, and lua_newthread() and lua_newcthread() take
a different number of parameters. Overriding the former with the
latter plus a default argument would be a possibility. You can
patch the core, if you want to avoid patching existing libraries.
But be careful, because the latter calls the former.
> I recompile luajit with uncommented line:
> COCOCFLAGS = -DCOCO_DISABLE
> but error remains. Why?
This is mentioned in the docs: "But note that this effectively
disables yielding from coroutines for JIT compiled functions."
I.e. you don't want to do this.
--Mike