From: Joel VanderWerf Date: 2009-09-07T17:14:05+09:00 Subject: Re: Executing system commands in threads under Ruby 1.8.6 vhaerun vh wrote: > I tried to write a script that makes use of external binaries. Each > external binary is called from a different thread, but, under 1.8.6, > this doesn't seem to work. Everything is executing in a sequential-like > manner. > The guys from StackOverflow said this was because of Ruby's thread > implementation ( and when I tried the same code under JRuby, it worked > ). > > Is there some way to make my script work under 1.8.6, or is upgrading to > 1.9 the only solution? What do you mean by external binary? Something you invoke with #system or the like? $ ruby -e 't=Thread.new {system "echo foo; sleep 1; echo bar"}; system "echo baz; sleep 1; echo quux"; t.join' foo baz bar quux Note the order of output: baz before bar. So it's not sequential. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407