Since thread IDs are unique, thread objects could be used as hash keys in a more rational way:'""' => \&tid
Also, it would also simply such things as:$timeouts{$thr} = $secs;
While this is not completely backward compatible, I'm wondering if that really matters. 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.print("Thread $thr running...\n");
As to other user code out in the Perl universe, the only code that would break would be cases where the current stringified version of a thread (i.e., 'threads=SCALAR(0x...)') is explicitly tested for. IMHO, I think that such a case would be extremely rare, and as such, would not justify blocking the proposed change.
Comments?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [RFC] Stringifying a thread
by diotalevi (Canon) on Oct 04, 2006 at 20:56 UTC | |
|
Re: [RFC] Stringifying a thread
by BrowserUk (Patriarch) on Oct 04, 2006 at 21:16 UTC | |
|
Re: [RFC] Stringifying a thread
by ambrus (Abbot) on Oct 05, 2006 at 16:36 UTC | |
|
Re: [RFC] Stringifying a thread
by samtregar (Abbot) on Oct 05, 2006 at 17:56 UTC | |
|
Re: [RFC] Stringifying a thread
by ysth (Canon) on Oct 06, 2006 at 10:01 UTC | |
by jdhedden (Deacon) on Oct 06, 2006 at 14:02 UTC | |
by BrowserUk (Patriarch) on Oct 06, 2006 at 15:02 UTC | |
by ysth (Canon) on Oct 06, 2006 at 17:24 UTC | |
by jdhedden (Deacon) on Oct 06, 2006 at 18:31 UTC |