Re: RFC 178 (v1) Lightweight Threads
[email protected] (Ken Fox) Fri, 08 Sep 2000 11:10:08 -0400
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Organization | None Apparent |
| Message-ID | <[email protected]> |
Steven W McDougall wrote: > How do `our' and `my' control mutex locking? I was assuming that all global (or "non-my" rather) variables would by default be shared when using a thread-enabled perl. That seems like a sensible default. If we're going to require the :shared modifier, then ignore my comments on "our" vs. "my". Regardless, it seems that perl must make a copy of a closure's environment for each thread the closure runs under. If a variable in the environment is marked :shared, only the proxy should be copied. This breaks closures, but seems unavoidable given the performance/deadlock problems of locking and the difficulty of figuring out whether a closure will run simultaneously in two different threads. - Ken