Hmm.....

Is there anything wrong with the existing interface, like

   $timeouts{$thr->tid} = $secs;

or 

   print("Thread ".$thr->tid." running...\n");

for example?  Neither of these have bothered me, or proven to be an
annoyance (at least to me).

I like the fact that threads are simple objects, like any other core
perl object.  I would be concerned about overloading operators with
threads objects, in the case there are any existing applications or
modules that expect (and use) the "string" form of threads objects.

   Is the intent is to implement a Class.toString() type behavior of
Java, such that using an object in string context prints a nice line of
details?  Given that threads is a core perl module and given that
accessing the TID is very easy already (e.g. ->tid), I'd recommend that
this behavior may be best left up to end implementors that subclass
threads to add such a behavior.

-Eric


--- Jerry Hedden <[EMAIL PROTECTED]> wrote:

> 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");
> 
> Comments?
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Reply via email to