Elizabeth Mattijsen wrote:At 10:00 -0800 1/12/04, Stas Bekman wrote:What's correct about it? I've detached the threads and shouldn't get any errors.% perl-5.8.3-ithread -le 'use threads; threads->new(sub { sleep 1})->detach for 1..1'Ah. That! That is considered to be correct behaviour (unless you're referring to the "2" instead of "1").
A thread exited while 2 threads were running.
The problem is not in the detach. the problem is that your program finishes before all the threads have finished. This was discussed extensively on p5p in the summer of 2002 prior to the 5.8.0 release. The problem is that a thread cannot continue if any other thread does an exit(). To indicate that you're doing that, the message occurs. Only problem is that the hidden thread that's used to store shared values, is counted as well.
One could argue that detached threads shouldn't be counted. But, as I said, a detached thread is also yanked from existence as soon as any other thread does an exit().
Hope this explains it a bit.
Liz
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]