Multicore Environment Programming - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Multicore Environment Programming

Description:

Core 2 Duo = 2 processors on a chip. Core 2 Quad = 2 sets ... My site: http://www.minnow-lang.org. Thanks. Images: http://www.pbase.com/bkbowden/image/69140176 ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 32
Provided by: Goog259
Category:

less

Transcript and Presenter's Notes

Title: Multicore Environment Programming


1
Multicore Environment Programming
  • BarCamp Blacksburg Summer 2008

2
Multicore Examples
3
Multicore Examples
  • ...pretty much everything since 2005
  • Intel Core 2 Duo, Core 2 Quad
  • AMD Athlon 64 X2, Phenom
  • As well as chips by Sun, IBM, and others (Cell,
    Sparc, etc)

4
...how many is multicore?
  • Core 2 Duo 2 processors on a chipCore 2 Quad
    2 sets of 2 processors on a chipOpterons are
    also 2- and 4-cores per chip

5
Then things get crazy...
6
If you wanted to...
  • You could build a 16-core computer today
  •  
  • AMD Opteron 2350 Barcelona 2.0GHz  x4 
    1016Tyan Tiger n4250QE 891.998 gigs ecc 
    200
  •  
  • Total 2107.99 case and ps
  •  

7
Sweet!!
  • That'll make everything super fast

8
Kinda, sorta, not really
  • Hardware scales to give us cores (and other ways
    of throwing more threads at the cpu)......but
    software doesn't "magically" go faster on these
    chips.

9
But we're coders
10
...it's our job to push the hardware, not the
other way around.
11
How we've been trying to push it...
12
How we've been trying to push it...
  • Threads

13
How we've been trying to push it...
  • Threads
  •  
  • Worker pools

14
How we've been trying to push it...
  • Threads
  •  
  • Worker pools
  •  
  • Combinations of the above (task parallel library)

15
Threads are easy until...
16
Threads are easy until...
  • you try to communicate between them

17
Locking
  • Where do you lock? 
  • In what order do you lock? 
  • Are all my modules locking in the same way? 
  • Do my locks compose well with 3rd party
    libraries?
  •  
  •  

18
That's a pain
  • But since we're coders, it's doable.

19
 Except that's not the problem...
  • The real trick is the simple fact that our
    programs now have a different kind of
    bottleneck. 

20
What we'd like to see is something like this
21
Thanks to academics, we have some options...
  • Pi Calculus
  • Join Calculus
  • Kleene Algebra-based orchestration
  • Streams
  • Communicating Sequential Processes
  • Requirements Annotations
  • Functional Decomposition
  • ...and countless other variations

22
What they have in common
  • Instead of just talking about a program as
    something that starts, does things, and
    finishes......let's talk about it as
    independent pieces working together.

23
What they have in common
  • Instead of just talking about a program as
    something that starts, does things, and
    finishes......let's talk about it as
    independent pieces working together....then we
    can let the compiler and/or runtime do the rest.

24
What we're talking about today
  • Bringing parallelism into OOP using actors
  • AKA Active objects

25
What we're talking about today
  • Bringing parallelism into OOP using actors
  • AKA Active objects
  • ...but we're going to work with them on a
    massive scale.

26
But what's an actor?
  • An actor
  • Is an object in the oop sense
  • Lives on its own thread, so it acts independently
    of the rest of the system
  • Can communicate with other actors in the system

27
Example Scatter
  • main
  •     start event handler
  •     start video
  •     start timekeeper
  •  
  • event handler
  •     get mouse (x,y)
  •     if button down
  •         create new dot
  •     msg all dots (x,y)
  • video
  •     render frame
  •     display next frame
  •  
  • timekeeper
  •     delay x ms
  •     msg event handler
  •  
  • dot
  •     get (x,y), calc new pos
  •     msg video new pos

28
For this to be possible, you need...
  • (Mostly) free threads
  • (Mostly) free messaging
  • (Mostly) no locks
  • Others?

29
Example Signal Proc. Optimization
30
To find out more
  • Erlang http//www.erlang.org
  •  
  • StreamIT http//www.cag.csail.mit.edu/streamit/
  •  
  • Wikipedia http//en.wikipedia.org/wiki/Actor_mode
    l
  •  
  • My site http//www.minnow-lang.org
  •  

31
Thanks
  • Images
  • http//www.pbase.com/bkbowden/image/69140176
  • http//www.toychestpenrith.co.uk/acatalog/Wooden_T
    oys.html
Write a Comment
User Comments (0)
About PowerShow.com