From: reynhout@... Date: 2009-07-14T21:07:33+09:00 Subject: Re: C ext / threading / callback issue, ruby-1.9.1p129 On Tue, Jul 14, 2009 at 10:57:07AM +0900, Roger Pack wrote: > > > There's a watcher thread (in C) that waits for an event (the creation of > > a file), then triggers whichever callback is specified. > > Hmm. MRI isn't "used" to other threads running--are you running 1.8.6 > or something else? I'm using 1.9.1p129, but I tried the FFI version under 1.8.6 too, and got similar MRI crashes and/or stuck threads. I did wrap the callback invocation inside rb_thread_blocking_region, though I'm not sure it's necessary for this sample code. I haven't written a 1.8.6 version of the C ext (the syntax/semantics are slightly different than 1.9), but I'd be very surprised to see anything change -- these failures are consistent with MRI through multiple versions and approaches. This code DOES work correctly under JRuby. JRuby has a different threading model, of course, but I don't understand it well enough to determine why it fails under MRI. Sample code and details at: http://github.com/reynhout/callme/ Thanks again, Andrew -- reynhout@quesera.com