Re: How to create another lua_State in pthread?

  • From: Mike Pall <mike-1301@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 23 Jan 2013 16:21:43 +0100

Hiroaki Nakamura wrote:
> How can we write that? Do we have to write that portion in C?
> Or we can write the function called from pthread_create() in lua?

You create a separate Lua state first, then define a callback
function in *that* state and then use pthread_create() from the
original state, passing the callback address of the other state.

--Mike

Other related posts: