At 12:47 PM 7/24/02 +0200, Arthur Bergman wrote:
>>Is it correct that detached threads will only last for the duration of
>>the scope of their object, such that:
>>
>>sub foo {
>> my $thr = threads->new(&bar);
>> $thr->detach;
>>}
>>will terminate the thread on exiting the function?
Do you mean exiting "foo" or exiting "bar"? From the rest of the mail I
got the impression you're thinking that the thread will exit when "foo" is
exited. That is not true. The thread will stop running (not exit!) as
soon as "bar" is done. An exit() in any thread will exit the entire
process, taking all other threads with it.
Hope I fixed a potential misconception here....
Liz