From: Im still Date: 2009-08-20T02:58:20+09:00 Subject: Re: a question with [Thread] --0014851eff1e1f68320471825f7d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit thanks Alex. I solved it that way. :D 2009/8/19 Alex > My guess is that since you're not joining the thread to the main > thread, it just terminates after the main thread exits. Try this: > > a = 0 > thread = Thread.new do > while true > puts "#{a+=1}" > end > end > thread.join > > > > Alex > > On Wed, Aug 19, 2009 at 9:51 AM, Im still wrote: > > hi > > when im running a code like this > > > > a = 0 > > Thread.start{ > > while true > > puts "#{a+=1}" > > end > > } > > > > This will be terminated automatically but wont keep on looping as > expected. > > And by my test, the running result will always terminated while a = > 41.means > > after putting "41" it stops. > > > > Im doing this in windows vista. I dont know if its OS related issue or > not. > > or maybe im doing wrong ? anyone can tell me? > > > > --0014851eff1e1f68320471825f7d--