From: Alex Fenton Date: 2007-12-13T16:36:51+09:00 Subject: Re: Korundum and threads Matthieu Riou wrote: > Then the thread I started first gets stopped. I'm guessing there's a native > call here that doesn't play well with Ruby green threads but is there a way > to ask the Application to run in the background without disrupting the > execution of other threads? I don't use Korundum, but generally GUI toolkits don't work well out of the box with Ruby's green threads, because when they're in the event loop, non-GUI threads don't get scheduled. The usual solution is to use the GUI toolkit's Timer class (eg Qt::Timer, Wx::Timer) which fires at a short, regular interval. When it fires, call something like Thread.pass or sleep, which will allow Ruby to give execution time to other threads. On Qt: http://www.lesismore.co.za/Qt_and_Ruby On wxRuby: http://rubyforge.org/pipermail/wxruby-users/2007-April/003055.html hth alex