Slide 1

Slide 1 text

Concurrency in Ruby by Rahul Trikha @rahult

Slide 2

Slide 2 text

What is Concurrency? Concurrency is when two tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. Eg. multitasking on a single- core machine. Parallelism is when tasks literally run at the same time, e.g. on a multicore processor.
 
 Quoting Sun's Multithreaded Programming Guide

Slide 3

Slide 3 text

Why do we need Concurrency? • The Power Wall • MultiCore CPUs • Blocking IO • Wasted Compute Cycles

Slide 4

Slide 4 text

Answer to our Problems? Restaurant Pager Systems

Slide 5

Slide 5 text

Concurrency Models • Threads and Locks • Almost all languages support this one way or another • Actors (Message passing via Actors) • Scala • Erlang • Elixir • Communicating sequential processes (Message passing via Channels) • Clojure's core.async • Go • Data Parallelism (Computing across Multiple Processors in Parallel Computing Environments) • Open Computing Language (OpenCL)

Slide 6

Slide 6 text

Actor Model "I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful)." Alan Kay