in reply to How do I get a unique Perl Interpreter ID?
prefer to stay in pure Perl if I possibly can.
AFAIK, outside of going into XS to create your own interpreter; thread == interpreter.
So, if you're staying in pure Perl -- and therefore not creating any Interpreters yourself explicitly; or implicitly other than via threads (& Windows fork emulation) -- then the combination of pid & tid should be unique.
Other than the possibility where the 32-bit tid wraps around, but if you're creating that many threads in a single process, then you could probably use the week number or maybe even month instead of the pid :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I get a unique Perl Interpreter ID?
by zwon (Abbot) on Dec 01, 2011 at 07:11 UTC |