Slideshare.net (beta)

 
Post to TwitterPost to Twitter
Post: 
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons

All comments

Add a comment on Slide 1

If you have a SlideShare account, login to comment; else you can comment as a guest


Showing 1-50 of 2 (more)

BayFP: Concurrent and Multicore Haskell

From bos31337, 5 months ago

An overview of the programming techniques available and some of th more

2158 views  |  15 comments  |  2 favorites  |  22 downloads  |  3 embeds (Stats)
 

Categories

Add Category
 
 

Groups / Events

 

 
Embed
options

More Info

This slideshow is Public
Total Views: 2158
on Slideshare: 1548
from embeds: 610

Slideshow transcript

Slide 1:Concurrent and Multicore Haskell

Slide 2: Concurrent Haskell • For responsive programs that multitask • Plain old threads, with a few twists • Popular programming model

Slide 3: A simple example backgroundWrite path contents = done <- newEmptyMVar forkIO $ do writeFile path contents putMVar done () return done

Slide 4: Imperative code!? • Threads, assignment, “return”... huh? • Haskell is a multi-paradigm language • Pure by default • Imperative when you need it

Slide 5: What’s an MVar? • An atomic variable • Either empty or full • takeMVar blocks if empty • putMVar blocks if full • Nice building block for mutual exclusion

Slide 6: Coding with MVars • Higher-order programming • modifyMVar: atomic modification • Safe critical sections • Combine MVars into a list