Re: Best Practice For Killing Thread?

[email protected] (Mike Pomraning)
Newsgroups perl.ithreads
Message-ID <[email protected]>
On Mon, 3 Nov 2003, Elizabeth Mattijsen wrote:

> At 14:26 -0600 11/3/03, Mike Pomraning wrote:
> >detached threads, there isn't really a way to figure out if the thread has
> >been internally reclaimed.
>
> Thread::Running ?   ;-)

Right.  :-)  Strictly speaking, there's still a gap between when
Thread::Running (via Thread::Exit's clever enclosure) reports a thread entry
sub to be completed and when the interpreter internally finishes the thread
(either explicitly by a user's join() or implicitly on a detached thread).

But that gap isn't very interesting or relevant.  The most bulletproof way to
know when a thread has finished is to do some bookkeeping and make sure that
program logic keeps the books correctly, and Thread::Running does this for
you.

-Mike
-- 
Michael J. Pomraning
[email protected]
http://pilcrow.madison.wi.us
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.