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
0
130
My Mom told me that Ruby isn't thread-safe
Smit Shah
November 16, 2013
Tweet
Share
More Decks by Smit Shah
See All by Smit Shah
Resillent By Design
who828
0
130
How does Bundler bundle?
who828
0
130
KDE is unlike a coconut
who828
0
120
Other Decks in Programming
See All in Programming
CSC307 Lecture 04
javiergs
PRO
0
660
高速開発のためのコード整理術
sutetotanuki
1
400
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
ぼくの開発環境2026
yuzneri
0
240
CSC307 Lecture 05
javiergs
PRO
0
500
Oxlintはいいぞ
yug1224
5
1.3k
Architectural Extensions
denyspoltorak
0
290
CSC307 Lecture 06
javiergs
PRO
0
690
Patterns of Patterns
denyspoltorak
0
1.4k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
980
AI巻き込み型コードレビューのススメ
nealle
2
420
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Visualization
eitanlees
150
17k
Exploring anti-patterns in Rails
aemeredith
2
250
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
54
ラッコキーワード サービス紹介資料
rakko
1
2.3M
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.6k
How STYLIGHT went responsive
nonsquared
100
6k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Done Done
chrislema
186
16k
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!