Re: RFC 178 (v1) Lightweight Threads
[email protected] (Ken Fox) Fri, 08 Sep 2000 11:17:34 -0400
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Organization | None Apparent |
| Message-ID | <[email protected]> |
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