From: Andrew Reynhout Date: 2009-07-14T22:48:52+09:00 Subject: Re: C ext / threading / callback issue, ruby-1.9.1p129 Roger Pack wrote: > Does the callback use ruby code from within the thread blocking region? Yes, e.g.: rb_thread_blocking_region((rb_blocking_function_t *)w->callback, tmp_x, RUBY_UBF_IO, 0); w->callback is the address of the Ruby proc. The address is correct afaict, but note that this does crash MRI before the callback appears to execute (dereferencing failure?). When w->callback is the address of the C function, the callback runs, but the Ruby threads apparently suspend. Both callbacks in this sample code are very simple -- they just print the int value of tmp_x, which is the number of seconds since the watcher thread was started. Thanks, Andrew -- Posted via http://www.ruby-forum.com/.