From: Francis Cianfrocca Date: 2006-06-21T07:34:52+09:00 Subject: Re: C Threads and Ruby ------=_Part_3443_21523358.1150842889288 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline >>>I, too, have need to wake up a ruby thread from a native thread in my application. Currently I'm using polling. My thinking was to use UDP over loopback. My ruby thread would sleep waiting for the C thread to send it a UDP packet. <<< Try this: create a pipe or socketpair in native code. Then you can create a ruby IO object from the file-descriptor of the read-side of the pipe. Then call Ruby's select (NOT the native select) on the IO object. When it selects readable, you run your Ruby code. This blocks neither your native threads nor your other Ruby threads. I know this works in both Unix and Windows, but the native code is slightly different. ------=_Part_3443_21523358.1150842889288--