RE: How to create another lua_State in pthread?

  • From: William Adams <william_a_adams@xxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Fri, 25 Jan 2013 14:07:33 +0000

I wrote some on this subject a while back:

http://williamaadams.wordpress.com/?s=lua+threads
http://williamaadams.wordpress.com/?s=lua+state

Maybe you'll find it useful.

===============================
- Shaping clay is easier than digging it out of the ground.
----------------------------------------
> Date: Fri, 25 Jan 2013 14:39:39 +0100
> From: mike-1301@xxxxxxxxxx
> To: luajit@xxxxxxxxxxxxx
> Subject: Re: How to create another lua_State in pthread?
>
> Hiroaki Nakamura wrote:
> > Now I am trying to get the callback function defined in another Lua state
> > and call pthread_create with the callback address.
>
> You must cast the Lua function ('hello') to a C function pointer
> and then to a number in the other state and then convert it back
> to a function pointer in the main state.
>
> Patch attached.
>
> --Mike                                          

Other related posts: