Brave New Concurrent World

Post on 23-Jan-2015

301 views 6 download

description

[talk from Webcamp Ljubljana 2009] A non-apologetic treatise on how to think concurrency. Contains exotic languages, swearing, and only a passing relevance to the web.

Transcript of Brave New Concurrent World

Brave New Concurrent World

Webcamp Ljubljana simon@hekovnik.si

Why should you give a fuck?

• More data > better algorithms

• Moore’s Law: from GHz to cores

• Conventional computation models are badly broken

Some big ideas in concurrency

Decouple temporal and spital order

a*(b*c)=(a*b)*c a+b=b+a

Associativity v. commutativity

• First/rest• Linked lists

• Partitions• trees

Linear v. multi-way decomposition

• Recursive updates • Map to singelton solutions

• Merge subsolutions

Accumulation v. merging

The future is a function of the past, it doesn’t change it

Identity is an illusion

There is no enduring changing entity

Immutable values

• Copy on change (pure functions)– State transitions never disturb prior– Structure sharing where possible

• Never need synchronization

Forget everything you know about performance

Do redundant operationsto reduce communication

Take extra space to permittemporal decoupling

Map/reduce

Concurrency in practice

Fine granularity

N(map tasks) >> N(machines)

Fault tolerance viare-execution

Refinements

• Redundant execution

• Locality optimizations– Master scheduler

How not to get (completely) ass-raped in the near future

• Functional programming

• Smart(er) compilers/run-times

Erlang, Clojure, (Haskell, Go, Fortress, ...)