Home  |  Linux  | Mysql  | PHP  | XML
From:Ben Morrow Date:Fri Aug  8 16:41:17 2008
Subject:Re: Devel::Callsite is a better instance key than join $;,caller()[1,2]
Quoth tzz@lifelogs.com (Ted Zlatanov):
> You're probably right.  I was thinking as a user of the module (with
> Every.pm), thanks for pointing this out.
> 
> From thrtut, it seems that threads->self()->tid() will return the thread
> ID, and of course $$ is the PID.  Is there a one-liner that will DTRT
> whether threads are loaded or not?  I couldn't find one, so the usage
> example may have to be a little more complex.

Just use the interpreter address: it's more unique than either pid or
tid, and actually reflects 'Perl-level thread of control'. I would say
that a second function in D::C (what, two whole functions in one module?
Shocking!) to return the interpreter address would be the way to go.

Ben

-- 
I touch the fire and it freezes me,                      [ben@morrow.me.uk]
I look into it and it's black.
Why can't I feel? My skin should crack and peel---
I want the fire back...                     BtVS, 'Once More With Feeling'
Navigate in group perl.module-authors at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants