I just found out that threads are indeed expensive... Even if my loop
sleeps for 2 minutes thread count continues to increment...  How do you
destroy a thread when you know that its job is done?

This is a 2K machine running the latest active perl.  I am using
ithreads.

-Dan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of $Bill
Luebkert
Sent: Tuesday, April 11, 2006 11:01 PM
To: [email protected]
Subject: Re: Threads?

Foo Ji-Haw wrote:

> Qualifier (from doc): it counts only non-joined, non-detached threads.

The list function - but if you keep track of the threads you create and
their joinedness and detachedness :), you don't need anything else
including the list function.  Just add some bookkeeping.

> $Bill Luebkert wrote:
> 
>>Daniel Rychlik wrote:
>>
>>  
>>
>>>Hello,
>>>
>>>I'm curious is to how you get a thread count from perl threads... 
>>>
>>>Surely there has to be a way... 
>>>    
>>
>>I would think you would keep track of them as you create them.
>>
>>Couldn't you just use threads->list() ?
>>
>>my @ret = threads->list();
>>print scalar @ret, "\n";      # add one if you want to include the
main/base thread
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to