On Sat, 30 Oct 2004, Bill Kelly wrote:

> From: "Robert Klemme" <bob.news / gmx.net>
>>>>    are there any issues with iterating Thread::list - since this list is
>>>>    obviously changing all the time in this code (new Threads started)
>>>
>>> Maybe,
>>>
>>>   while th = Thread::list.find {|t| t != Thread.current}
>>>     begin
>>>       th.join
>>>     rescue => e
>>>       warn{ e }
>>>     end
>>>   end
>>
>> This does not make a difference as Thread.list() creates a new array on
>> each invokation:
>>
>>>> Thread.list().id
>> => 135026036
>>>> Thread.list().id
>> => 135022100
>>>> Thread.list().id
>> => 135018212
>
> The OP mentioned the possibility of new threads being created
> all the while.  I had read that as the OP wanting to ensure
> that we would handle the joining any new threads that may have
> become spawned while we were trying to shut down others.
> So my proposed solution was intended to loop until all threads
> were truly joined...

exactly correct - i'll examine your code.

thanks!

-a
--
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| When you do something, you should burn yourself completely, like a good
| bonfire, leaving no trace of yourself.  --Shunryu Suzuki
===============================================================================