"attempt to yield across metamethod/C-call boundary" with LuaJIT but not with Lua
this is my first post on this list so I hope I am following all rules properly.
I just encountered the dreadful "attempt to yield across
metamethod/C-call boundary" error.
Worst part is I am getting different behavior with different
lua51.dll. With original Lua 5.1.4
attached code runs fine - no errors but when LuaJIT 1.1.7 is used error occurs.
My question is: is this code correct? If yes, why LuaJIT reports error?
Re: "attempt to yield across metamethod/C-call boundary" with LuaJIT but not with Lua
Side note. I tried to compile your example. It was not easy because I
had to install both luabind and the huge Boost++ library.
For the matter of comparison, I tried to port that code to my
LuaClassBasedCall binding (a single header file).
I realized that unlike luabind, my library has no special support for
coroutines, so it was easier to create / resume the coroutine in Lua
Still the resulting code is shorter, and IMHO easier to understand...
> You need to use lua_newcthread(). Otherwise LuaJIT 1.x doesn't create a
> C stack.
> Or you can use LuaJIT 2.x, which uses a different yielding method.
So code I posted is in fact valid? I though LuaJIT was suppos e to be
"drop-in replacement". Obliviously both VMs behave very differently.
To be hones I still don't quite understand what that error message means.
> Side note. I tried to compile your example. [snip]
Thanks for the effort but I am way too far with luabind to switch now
and actually I am very happy with it. Other thing is that I don't want
scripters to be even aware of their code running in coroutines. All
yielding/resuming is happening in C++ while scripters only focus on
The Lordz Games Studio