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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
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エージェントの隔離技術の徹底比較
kawayu
0
450
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
さぁV100、メモリをお食べ・・・
nilpe
0
120
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
AIとRubyの静的型付け
ukin0k0
0
510
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
260
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
440
CSC307 Lecture 17
javiergs
PRO
0
310
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
220
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
430
関係性から理解する"同一性"の型用語たち
pvcresin
2
630
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
460
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
230
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
330
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
220
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The SEO Collaboration Effect
kristinabergwall1
1
470
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!