From: Per-erik Martin Date: 2013-05-04T01:32:36+09:00 Subject: Re: ruby 2.0 with tk 8.5 on Raspberry Pi I finally managed to find a way to work around this problem. I hesitate to call is a "solution", since I still don't know exactly why it behaves this way, or why the workaround works... It's clear that there was something fishy going on with the thread scheduling, so I've done lots of testing with threads in ruby on the RPi, but couldn't find anything strange there. It seems the issue, whatever it is, is at least partly in the tk library, or tk binding in ruby. Reading tk.rb finally made me suspect the RUN_EVENTLOOP_ON_MAIN_THREAD setting which seems to be set differently depending on platform. And lo and behold, changing line 1239 in tk.rb: RUN_EVENTLOOP_ON_MAIN_THREAD = false into RUN_EVENTLOOP_ON_MAIN_THREAD = true made it work! I know this isn't the the correct fix, but will do for me now; this has been a major show-stopper for me. (It really should detect the Raspberry Pi platform and set it for this only, but I'm not going to bother about that now.) One question remains: Why does this has to be different on Raspberry Pi running wheezy? It's not needed on Ubuntu or Mac OS X (unless you're running and older tk version. Is it something with the tk build on RPi? Or the pthread libraries on RPi? Or is it something about the arm architecture? -- Posted via http://www.ruby-forum.com/.