Steven W McDougall wrote:
> Question: Can the interpreter determine when a variable becomes
> shared?
> 
> Answer: No. Then neglecting to put a :shared attribute on a shared
> variable will crash the interpreter. This doesn't seem very Perlish.

If the variable isn't :shared then how can it be shared?! In other
words, if it's not :shared, you're going to get a copy of the variable
for each thread. AFAIK, the only places where this is visible are
global variables and closures. Sharing globals by default reduces this
to sort of an expert-mode-only detail. (Presumably someone is quite
expert with Perl if she is threading closures!)

- Ken

Reply via email to