lua-users home
lua-l archive

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


Mike Pall wrote:
You cannot yield from a thread in LuaJIT 1.x if you don't give it
its own C stack. The standard coroutine.create() and coroutine.wrap()
functions already do this for you. Rewrite your example in pure Lua
code and you'll see it works out-of-the-box.

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

I recompile luajit with uncommented line:
COCOCFLAGS = -DCOCO_DISABLE
but error remains. Why?