Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
My Mom told me that Ruby isn't thread-safe
Search
Smit Shah
November 16, 2013
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
My Mom told me that Ruby isn't thread-safe
Smit Shah
November 16, 2013
More Decks by Smit Shah
See All by Smit Shah
Resillent By Design
who828
0
140
How does Bundler bundle?
who828
0
140
KDE is unlike a coconut
who828
0
130
Other Decks in Programming
See All in Programming
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
ふつうのFeature Flag実践入門
irof
8
4.1k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
Webフレームワークの ベンチマークについて
yusukebe
0
180
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
170
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.4k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
900
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
730
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
380
AIで効率化できた業務・日常
ochtum
0
140
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
610
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
170
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Into the Great Unknown - MozCon
thekraken
41
2.6k
Design in an AI World
tapps
1
250
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
Paper Plane
katiecoart
PRO
1
52k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
150
Transcript
Ruby my me told mom that isn’t thread-safe
SHE WAS RIGHT and I was left
Smit Shah github.com/who828 twitter.com/who828
Concurrency? what is
1.Concurrency is about dealing with lots of things at once
like dealing with this exam paper
2.Concurrency is about context switching
like attempting another question! in case you’re stuck
SQL Controller Render Response Controller SQL Response Render Without concurrency
in your web server Request 1 Request 2
SQL Controller Render Response Controller SQL Response Render With concurrency
in your web server Request 1 Request 2
Ruby supports concurrency through threads
Ruby supports concurrency through threads *conditions apply
Parallelism? what is
1.Parallelism is about doing lots of things at once
it’s like getting your friend to write the exam,! while
you go watch a movie
2.No one can guarantee that your code will run in
parallel.
aside from Rajnikanth
and the kernel scheduler
Ruby ! doesn’t support parallelism through threads
use JRuby Ways to achieve parallelism
this JRuby disclaimer is brought to you by Flipkart
use JRuby Ways to achieve parallelism use :(){ :|:& };:
Thread-safety? what about
None
(the rainbows are just to make it hurt less)
“gee, I don’t really need to care about thread-safety because
of the GIL”
“gee, I don’t really need to care about thread-safety because
of the GIL”
About the GIL few words
Managing thread-safety
Managing thread-safety get drunk and forget about it
Managing thread-safety get drunk and forget about it avoid global
mutations
Managing thread-safety get drunk and forget about it avoid global
mutations prefer thread-locals
Managing thread-safety get drunk and forget about it avoid global
mutations prefer thread-locals use the right data structures
Managing thread-safety get drunk and forget about it avoid global
mutations prefer thread-locals use the right data structures just learn about functional programming already
Bundler example
Pepperidge Farm wants you to remember
“The Only Sure Thing in Computer Science, Everything is a
tradeoff” – Van Roy and Haridi, Concepts, Techniques, and Models of Computer Programming
thanks!