lua-users home
lua-l archive

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


> Consider code
> - In C having L1 as reference
> - it calls Lua code
> - The Lua code calls another C function, having L2 as reference
> 
> If you name it lua_Thread, you would assume L1 and L2 would be the same, as they run on the same coroutine/thread. But they are not the same, they both have their own stack to interact with Lua.

But L1 and L2 will be the same (that is, L1 == L2)! Each routine has its
own stack, but they use the same PIET to refer to their stacks (unless
they are in different threads).

-- Roberto