Re: RFC 178 (v1) Lightweight Threads
[email protected] (Steven W McDougall) Sun, 3 Sep 2000 21:35:17 -0400 (EDT)
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Message-ID | <[email protected]> |
> There is a fundemental issue on how values are passed between > threads. Does the value leave one thread and enter the other or are > they shared. > The idea tossed around -internals was that a value that crosses a thread > boundary would have a wrapper/proxy attached to handle the mediation. > The mediation would be activated only if the value is passed via a > shared variable. In your case the shared variable is the argument > being passed through the thread creation call. [...] > If we don't require a :shared on variable anything and everything > has to have protection. If you want the variable to be shared > declare it. [...] > Aha, I get it. -internals has been assuming that one _must_ specify > the sharing. You want it to be infered. > I think that's asking for too much DWIMery. 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. Answer: Yes. Then the interpreter can take the opportunity to install a mutex on the variable. - SWM