Re: [RFC] Stringify a thread

[email protected] (Jerry Hedden) Wed, 4 Oct 2006 13:09:07 -0700 (PDT)
Newsgroups perl.perl5.porters,perl.ithreads
Message-ID <[email protected]>
Jerry D. Hedden proposed:
> I'm considering a one line addition to the threads module
> to overload the string value of a thread to return its ID:
> 
>   '""' => sub { shift->tid() }
> 
> Since thread IDs are unique, thread objects could be used
> as hash keys in a more rational way:
>   $timeouts{$thr} = $secs;
> 
> Also, it would also simply such things as:
>   print("Thread $thr running...\n");

Nicholas Clark commented:
> I can't see that it's backwards compatible.

Does it have to be?  For example, according to CPANTS there are no CPAN
modules that have 'threads' as a requirement other than
'thread::shared', 'Thread::Suspend' and 'Thread::Cancel', and I know
they won't break.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com