Im still wrote:
when im running a code like this
a = 0
This will be terminated automatically but wont keep on looping as
When a Ruby program terminates, all threads are killed, regardless of
their states. (pickaxe2 p. 137)
And by my test, the running result will always terminated while a =
after putting “41” it stops.
It seems strange to me that the thread would get killed at the same
point every time.
Im doing this in windows vista. I dont know if its OS related issue or
or maybe im doing wrong ? anyone can tell me?
…you can wait for a particular thread to finish by calling that
thread’s Thread#join method. The calling thread [e.g. your main
program] will block until the given thread is finished…If you don’t
want to block forever, you can give join a timeout parameter…
(pickaxe2 p. 137)