From: Lyle Johnson Date: 2002-12-04T09:48:45+09:00 Subject: Re: Fox threading issues David Naseby wrote: > The program shows the Linux like behaviour on Windows for me (locking up). I > use ruby 1.6.7 (2002-09-12) [i586-mswin32], obtained from > http://www.ruby-lang.org/~usa/mswin32/ruby-1.6.7-20020912-1586-mswin32.zip > and copied over the ruby directory installed by the Prag Prog windows > installer. Threads are broken for the Windows version of Ruby 1.6.7. This has always been true and will always be true. It is not, and never was, an FXRuby bug. This bug is fixed in the CVS sources for Ruby 1.6.8 and Ruby 1.7.3. > The lockups are caused by repeating the addTimeOuts. FXApp#addTimeOut is a > buggy method under FXRuby at present. Use Ruby threads for repetitious > control, avoid Fox timeouts like the plague. I think David is correct that *something* is wrong for FXApp#addTimeout, although several of the FXRuby example programs use them without ever locking up. One minor change that would eventually need to be made to Steve's program is to of course lock the mutex before resetting the $count in the button's command handler, i.e. button.connect(SEL_COMMAND) do $lock.synchronize { $count = 0 } end I also found that if I increase the sleep time in the thread from zero to some small-but-non-zero value (e.g. sleep 0.001) it seems to work OK -- not sure what that means yet. > Of course, I hope that Lyle can contradict me. Me too ;) I went ahead and put this on the bug list.