On Fri, 18 Jun 2004 06:38:22 +0900, Paul wrote
> I have many threads that I leave running, doing things in the
> background. I end up writing a lot of code like the following - is
> there a way to make a thread run, avoiding the while(1) ?
> 
> Thanks
> 
> Paul
> 
> a = Thread.new(){ 
>    aa = 0
>    while(1)
>        puts "a thread: #{aa}"
>        aa=aa+1
>    end
> }

Do you just want a different looping construct?

a = Thread.new {
  aa = 0
  loop do
    puts "a thread: #{aa}"
    aa += 1
  end
}


Kirk Haines