develooper Front page | perl.perl6.language | Postings from October 2010

Re: threads?

Thread Previous | Thread Next
From:
Dave Whipp
Date:
October 12, 2010 15:08
Subject:
Re: threads?
Message ID:
20101012220852.29740.qmail@lists-nntp.develooper.com
Damian Conway wrote:

> 
> Perhaps we need to think more Perlishly and reframe the entire question.
> Not: "What threading model do we need?", but: "What kinds of non-sequential
> programming tasks do we want to make easy...and how would we like to be
> able to specify those tasks?"
> 

The mindset that I use goes something like "most tasks are potentially 
concurrent: sequentialization is an optimization that most people 
perform without even thinking".

Generally, I would split concurrency into producer-consumer (i.e. 
message passing) and stream-processing (for hyper and reduction 
operators -- possibly also for feeds, with a kernel per step). When 
dealing with compute-tasks, you're basically just choosing how to map a 
dependency graph to the available compute resources. When dealing with 
external resources (e.g. sockets, GUI) then explicit parallelism (via 
message passing) becomes useful.

P6 already specifies a whole bunch of non-sequential tasks (hypers, 
reductions, feeds, background-lazy lists), so no need to reframe the 
entire question just yet. Implementing the existing concurrency will 
flush out plenty of flaws in the specs.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About