El Martes, 20 de Octubre de 2009, pawel escribi
> Why this simple program give no output, and terminates immidiatly
> after its launched? There should be thread running and giving lots of
> 'lala', am I right?
> class Bar
>   def initialize
> 
>   end
>   def foo
>      Thread.new do
>       while true
>         puts "lala\n"
>       end
>     end
>   end
> end
> 
> b=Bar.new
> b.foo
> 


When you create a thread, the main threads continues. In you case the main 
thread terminates after calling "Thread.new" so the program exists.

If you want to *wait* all the created threads to finish their work, then you 
must "join" them:

  my_thread = Thread.new do .... end
  do other stuff in main thread
  my_thread.join



-- 
Iki Baz Castillo <ibc / aliax.net>