From: Cd Cd Date: 2007-09-12T13:42:06+09:00 Subject: Re: Threads and daemons Cd Cd wrote: >> >> Whenever I see `...` or %x{...} without it being an assignment it >> triggers me to question it. >> >>> So do I move join into the do/end block? >> >> Try this modification to your program: >> >> #!/usr/bin/env ruby >> threads = [] >> 4.times do >> threads << Thread.new do >> output = %x{/usr/local/bin/party} >> puts "party output: " + output >> end >> end >> threads.each{|thr| thr.join} >> exit 0 >> >> Is there any output from your "party" program? I am hoping there will >> be errors shown there that were not displayed before that will lead >> you to the problem. >> > > I see > Welcome to PARTY! Type '?' for help: > > When I step through the program via the ruby debugger. Sometimes ill see > the same thing when I run the program. It varies from run to run And on an interesting side note, the status of the program is sleeping when I run your version 10123 0.0 0.4 1076 1900 pb S+ 12:39AM 0:00.01 ruby ./party.rb However, when I run my version, the status of the program show that it has been stopped. -- Posted via http://www.ruby-forum.com/.