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
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
130
How does Bundler bundle?
who828
0
130
KDE is unlike a coconut
who828
0
120
Other Decks in Programming
See All in Programming
おれのAgentic Coding 2026/03
tsukasagr
1
130
モダンOBSプラグイン開発
umireon
0
200
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
120
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
200
事業会社でのセキュリティ長期インターンについて
masachikaura
0
220
ファインチューニングせずメインコンペを解く方法
pokutuna
0
260
AI 開発合宿を通して得た学び
niftycorp
PRO
0
200
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
240
How to stabilize UI tests using XCTest
akkeylab
0
150
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.5k
KagglerがMixSeekを触ってみた
morim
0
360
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
1
210
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
140
sira's awesome portfolio website redesign presentation
elsirapls
0
210
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
500
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
94
Rails Girls Zürich Keynote
gr2m
96
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
Deep Space Network (abreviated)
tonyrice
0
100
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Crafting Experiences
bethany
1
100
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
120
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.4k
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!