An End to Order
many cores with java
session two
parallelism in a single core
copyright 2013 Robert Burrell Donkin robertburrelldonkin.name
this work is licensed under a Creative Commons Attribution 3.0 Unported License
Pre-emptive multi-tasking operating
systems use involuntary context
switching to provide the illusion of
parallel processes even when the
hardware supports only a single thread
of execution.
Take Away from Session One
Reflecting on the Exercises
● Pre-emptive
○ not time sharing
● Code can be interrupted...
○ at almost any time
● Concurrent Java is platform independent...
○ only when the rules are followed
If Only Single Cores Were So Simple
● Moore's Law
○ Number of transistors doubles every 2 years
● Pipelines
○ Small steps
○ Improves throughput
○ Facilitates higher clock
● How Long?
○ IBM Stretch - Fetch, Decode, and Execute
○ Classic RISC - 5 steps
○ Pentium D - 31 steps
An End to Order
● out of order execution
○ execution order
■ governed by efficiency
■ not program order
● serial execution is an illusion created by
a conspiracy of
○ core
○ compiler and
○ platform
● enter the Java Memory Model
Parallel Pipelines
● Superscalar
○ instruction level parallelism
● Siumultaneous MultiThreading
○ aka HyperThreading
○ hardware support for multiple threads of execution
within the same core
○ shared caches
What makes Parallelism Hard...?
● High-dimensional problem space
○ lots of potential solutions
● Unpredicatable
○ non-linearity
● Analysis is expensive
○ potentially entire system must be known
Concurrent Qualities
Recall:
● Responsiveness
○ to human (or other external) actors
● Liveliness
○ an intrinsic quality
○ all tasks continue to make progress
Performance Qualities
(following Doug Lea)
● Throughput
○ operations per unit time
● Latency
○ time taken to service a message
● Efficiency
○ computational resources required to achieve a level
of throughput
Performance Qualities
(following Doug Lea)
● Capacity
○ number of simultaneous tasks
■ for target throughput or latency
● Scalability
○ rate at which throughput or latency improves
■ when resources are added
● Degradation
○ rate at which throughput or latency improves
■ when activities are added
Even on a single core,
there's no escaping parallelism.
Take Away

An End to Order (many cores with java, session two)

  • 1.
    An End toOrder many cores with java session two parallelism in a single core copyright 2013 Robert Burrell Donkin robertburrelldonkin.name this work is licensed under a Creative Commons Attribution 3.0 Unported License
  • 2.
    Pre-emptive multi-tasking operating systemsuse involuntary context switching to provide the illusion of parallel processes even when the hardware supports only a single thread of execution. Take Away from Session One
  • 3.
    Reflecting on theExercises ● Pre-emptive ○ not time sharing ● Code can be interrupted... ○ at almost any time ● Concurrent Java is platform independent... ○ only when the rules are followed
  • 4.
    If Only SingleCores Were So Simple ● Moore's Law ○ Number of transistors doubles every 2 years ● Pipelines ○ Small steps ○ Improves throughput ○ Facilitates higher clock ● How Long? ○ IBM Stretch - Fetch, Decode, and Execute ○ Classic RISC - 5 steps ○ Pentium D - 31 steps
  • 5.
    An End toOrder ● out of order execution ○ execution order ■ governed by efficiency ■ not program order ● serial execution is an illusion created by a conspiracy of ○ core ○ compiler and ○ platform ● enter the Java Memory Model
  • 6.
    Parallel Pipelines ● Superscalar ○instruction level parallelism ● Siumultaneous MultiThreading ○ aka HyperThreading ○ hardware support for multiple threads of execution within the same core ○ shared caches
  • 7.
    What makes ParallelismHard...? ● High-dimensional problem space ○ lots of potential solutions ● Unpredicatable ○ non-linearity ● Analysis is expensive ○ potentially entire system must be known
  • 8.
    Concurrent Qualities Recall: ● Responsiveness ○to human (or other external) actors ● Liveliness ○ an intrinsic quality ○ all tasks continue to make progress
  • 9.
    Performance Qualities (following DougLea) ● Throughput ○ operations per unit time ● Latency ○ time taken to service a message ● Efficiency ○ computational resources required to achieve a level of throughput
  • 10.
    Performance Qualities (following DougLea) ● Capacity ○ number of simultaneous tasks ■ for target throughput or latency ● Scalability ○ rate at which throughput or latency improves ■ when resources are added ● Degradation ○ rate at which throughput or latency improves ■ when activities are added
  • 11.
    Even on asingle core, there's no escaping parallelism. Take Away