lua-users home
lua-l archive

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


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