nio4r and the Ruby GIL revisited

Marc Lehmann schmorp at
Fri Mar 2 21:51:03 CET 2012

> Is there a better solution here? I would really love to get rid of this

What's wrong with ev_set_loop_release_cb? What you describe looks very much
like the THREAD LOCKING EXAMPLE in the libev documentation.

Also, your solution seems to lack proper locking of the loop - unless ruby
somehow guarantees that you need to avoid two threads running the same
event loop. That could be achieved by putting a (recursive) mutex around
the ev_run call.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list