Treasure Island

98
Treasure Island

description

Treasure Island - Railsberry 2012 - Krakow. Talk about concurrency in Ruby and JRuby in particular. Ruby is pretty unique among scripting languages in having not only one but six (!) fairly mature runtime environments -- MRI, Rubinius, JRuby, MacRuby, IronRuby and MagLev -- each of them with specific strengths. In this talk I will first give a brief overview of planet Ruby and its continents. Then we will embark together on a journey into the deepest concurrency jungles on Java island, where strange beasts like Kilim, Jetlang and Akka roam. With a little luck, we might even encounter the legendary Disruptor! Using examples taken from actual production JRuby code, I will demonstrate how the power of the JVM plus the rich ecosystem around it are an ideal complement to the expressiveness of Ruby -- and how this killer combination can be used to fully exploit modern multicore hardware. Speakers: Tim Lossen, Patrick Huesler

Transcript of Treasure Island

Page 1: Treasure Island

Treasure Island

Page 2: Treasure Island
Page 3: Treasure Island

Tour Guides

Page 4: Treasure Island
Page 5: Treasure Island
Page 6: Treasure Island

@tlossen

Page 7: Treasure Island

@phuesler

Page 8: Treasure Island
Page 9: Treasure Island

“The Free Lunch is Over.”— Herb Sutter (!""#)

Page 10: Treasure Island
Page 11: Treasure Island

Concurrency

Page 12: Treasure Island
Page 13: Treasure Island
Page 14: Treasure Island

Fin?

Page 15: Treasure Island
Page 16: Treasure Island

Concurrency

Page 17: Treasure Island

Multi Core

Page 18: Treasure Island
Page 19: Treasure Island
Page 20: Treasure Island

Thread Concurrency

Page 21: Treasure Island

!fork()

Page 22: Treasure Island

Rubies!!!

Page 23: Treasure Island

GIL

Page 25: Treasure Island

Ruby MRI 1.8 X

REE 1.8 X

Ruby MRI 1.9 X

IronRuby (✔)

Maglev ?

Rubinius ✔

JRuby ✔

MacRuby ✔

Page 26: Treasure Island

JRuby

Page 27: Treasure Island

Java Island

Page 28: Treasure Island

Multi-Threading

Page 29: Treasure Island
Page 30: Treasure Island

Evil?

Page 31: Treasure Island
Page 32: Treasure Island
Page 33: Treasure Island
Page 34: Treasure Island

java.util.concurrent

Page 35: Treasure Island
Page 36: Treasure Island
Page 37: Treasure Island

AtomicBoolean

Page 38: Treasure Island

CountDownLatch

Page 39: Treasure Island

Cyclic Barrier

Page 40: Treasure Island
Page 41: Treasure Island

Executor

Page 42: Treasure Island

Future

Page 43: Treasure Island
Page 44: Treasure Island

Actors

Page 45: Treasure Island
Page 46: Treasure Island

Bad Actors

Page 47: Treasure Island
Page 48: Treasure Island

and the nominees are...

Page 49: Treasure Island
Page 50: Treasure Island

MRI

Page 51: Treasure Island

Better Actors

Page 52: Treasure Island

Erlang

Page 53: Treasure Island

Scala

Page 54: Treasure Island

Rubinius

Page 55: Treasure Island

JRuby

Page 56: Treasure Island

Frameworks

Page 57: Treasure Island
Page 58: Treasure Island
Page 59: Treasure Island

Akka

Page 60: Treasure Island
Page 61: Treasure Island

Scala

Page 62: Treasure Island

Heavily Inspired by Erlang

Page 63: Treasure Island

Simple Concurrency

Page 64: Treasure Island

Distributed

Page 65: Treasure Island

Fault Tolerant

Page 66: Treasure Island

Supervisors

Page 67: Treasure Island
Page 68: Treasure Island

Fast

Page 69: Treasure Island
Page 70: Treasure Island

Can it be used with JRuby?

Page 71: Treasure Island

Yes*

Page 72: Treasure Island

Moarrrrr!!!!

Page 73: Treasure Island

STM

Page 74: Treasure Island
Page 75: Treasure Island
Page 76: Treasure Island
Page 77: Treasure Island
Page 78: Treasure Island
Page 79: Treasure Island
Page 80: Treasure Island
Page 81: Treasure Island
Page 82: Treasure Island
Page 83: Treasure Island
Page 84: Treasure Island
Page 85: Treasure Island
Page 86: Treasure Island
Page 87: Treasure Island
Page 88: Treasure Island
Page 89: Treasure Island
Page 90: Treasure Island

Evented

Page 91: Treasure Island

Disruptor

Page 93: Treasure Island

Q & A

Page 94: Treasure Island

“There ain’t no such thing as a free lunch.”— Robert A. Heinlein

Page 96: Treasure Island
Page 97: Treasure Island

CreditsAjith Kumar (Flickr)

tontoncopt (Flickr)

Hatem Riahi (Flickr)

Stefanie (Flickr)

Page 98: Treasure Island

CreditsBarry Skeates (Flickr)

Hillary White (Flickr)

David Thompson (Flickr)

“Dope Zebra”, Rhett & Link