P. 1
Multicore programming in Haskell

Multicore programming in Haskell

Ratings: (0)|Views: 1,734 |Likes:
Published by Don Stewart
http://qconlondon.com/london-2010/speaker/Simon+Marlow

http://www.haskell.org/~simonmar/multicore-haskell-marlow-qcon2010.pdf

The key to unlocking accessible concurrent programming lies in controlling interactions: to run a program in parallel we have to understand the interactions between the parallel tasks. Many of the better concurrent programming models rely on reducing interactions. In message passing, for example, interactions only occur through messages.

Haskell is a pure functional lanugage, which means that the default is zero interaction, and access to state is tightly controlled by the type system. So it should come as no surprise that Haskell is establishing itself not only as a testbed for concurrent programming models, but also as a realistic platform for multicore programming.

In this talk I'll give a tour of concurrency from the Haskell viewpoint through various practical examples. I'll explain why we believe there is no "one size fits all" concurrent programming model. Haskell provides thread-based concurrency with a choice of synchronisation mechanisms for situations where those models fit best, but also pure parallel programming models that are often a better choice when the goal is to parallelise a compute-intensive task.
http://qconlondon.com/london-2010/speaker/Simon+Marlow

http://www.haskell.org/~simonmar/multicore-haskell-marlow-qcon2010.pdf

The key to unlocking accessible concurrent programming lies in controlling interactions: to run a program in parallel we have to understand the interactions between the parallel tasks. Many of the better concurrent programming models rely on reducing interactions. In message passing, for example, interactions only occur through messages.

Haskell is a pure functional lanugage, which means that the default is zero interaction, and access to state is tightly controlled by the type system. So it should come as no surprise that Haskell is establishing itself not only as a testbed for concurrent programming models, but also as a realistic platform for multicore programming.

In this talk I'll give a tour of concurrency from the Haskell viewpoint through various practical examples. I'll explain why we believe there is no "one size fits all" concurrent programming model. Haskell provides thread-based concurrency with a choice of synchronisation mechanisms for situations where those models fit best, but also pure parallel programming models that are often a better choice when the goal is to parallelise a compute-intensive task.

More info:

Published by: Don Stewart on Mar 14, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/29/2012

pdf

text

original

 
Multicoreprogramming inHaskell
Simon MarlowMicrosoft Research
 
A concurrent web server
server :: Socket -> IO ()server sock =forever(doacc <-Network.acceptsockforkIO(http acc))
 
create a new threadfor each new clientthe client/serverprotocol is implementedin a single-threaded way
 
Concurrency = abstraction
Threads let us implement individualinteractions separately, but have them happen
“at the same time”
writing this with a single event loop is complexand error-prone
Concurrency is for making your program
cleaner 
.

Activity (11)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Chun Kit Lau liked this
Chun Kit Lau liked this
Chun Kit Lau liked this
Chun Kit Lau liked this
Chun Kit Lau liked this
Chun Kit Lau liked this
gerry liked this
mmartinb75 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->