On Tue, Oct 12, 2010 at 07:22:33AM -0700, Damian Conway wrote: > What we really need is some anecdotal evidence from folks who are actually > using threading in real-world situations (in *any* languages). What has worked > in practice? What has worked well? What was painful? What was error-prone? > And for which kinds of tasks? > > And we also need to stand back a little further and ask: is "threading" > the right approach at all? Do threads work in *any* language? Are there > better metaphors? > [...]
I agree fully with Damian. At YAPC::EU in Pisa, I proposed that since questions of threading and concurrency in Perl 6 (and Parrot) seem to be eternally asked and unanswered questions, that we probably need to start pushing on the answer at least a little bit, if only to have some implementation-level issues to frame discussion and help illustrate the overall outlines of an answer a bit better. My guess is that the overall question of threading and concurrency may be too large/vague to be attacked at once, so let's break it down into smaller, real-world use cases and see if we can find some patterns from those. In Rakudo's case, my plan is to focus on developing some sort of concurrent implementation of the Perl 6 hyperoperators (which ATM is one of Perl 6's most natural expressions of concurrency). Once we have a basic concurrent hyperoperator implementation -- even if it's not a particularly good one, we'll have a lot better understanding of the issues. We can better understand how concurrency might be expressed in other parts of the language, and we can provide Parrot and other underlying runtimes with real examples of the kind of concurrency primitives we'd like to have available. Then, with a few more examples in hand, I think we can start to get at some answers as to what a "Perl concurrency" solution will look like. [N.B.: This is very similar to what has happened in other parts of Perl 6, such as regular expressions and grammars. We didn't get a good feel for what was needed until we actually went through the exercise of building a few Perl 6 standard grammars/parsers in Perl 6.] Pm