"Re: [ruby-gnome2-devel-en] [patch] Fix ruby-glib thread handling" on Sat, 5 Apr 2008 17:40:56 +0200,
Sjoerd Simons <sjoerd@...> wrote:
> On Tue, Apr 01, 2008 at 12:06:47AM +0900, Kouhei Sutou wrote:
> > Hi,
> > In <20080330142259.GA16453@...>
> > "[ruby-gnome2-devel-en] [patch] Fix ruby-glib thread handling" on Sun, 30 Mar 2008 16:22:59 +0200,
> > Sjoerd Simons <sjoerd@...> wrote:
> > > Attached patch fixes the way ruby-glib handles signals from threads. This
> > > means it reverts to using a pipe like system so the main ruby thread can
> > > select on it to ensure it runs when needed. The main difference that is that
> > > we use IO.pipe instead of pipe() to create the pipe, which should make the
> > > code portable. I also added a test-case showing the effect, it would be nice
> > > if someone could test this on a win32 system just to be sure
> > It's simple that we use _pipe() on Windows rather than using
> > IO.pipe.
> Ah nice, i'll do something similar in the threaded gstreamer calls then. The
> only problem with your patch i saw is that you do the pipe() call inside the
> created ruby thread. Which means it's not guaranteed that it will be done
> when the first signal comes in (or at least afaik rb_thread_create does not
> guarantee the created thread will be executed first). So a little fix for
> that attached.
Please commit your patch.