FFI - coroutine.yield/resume inside callback

  • From: Richard Hundt <richardhundt@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 24 May 2012 09:16:12 +0200

Hi *,

should it be safe to yield/resume coroutines from inside a Lua function passed 
as a callback to a C function via the FFI?

Obviously it's not working for me (segfaults), however I'm using libuv's idle 
handler via the FFI to schedule coroutines, so there are a lot of moving parts 
and libuv may be doing something funky, so just wondering if it should work in 
principle.

Thanks,
Richard

Other related posts: