Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Concurrency in the imperative and functional world
Search
Scalone
November 17, 2015
Programming
0
170
Concurrency in the imperative and functional world
Presentation created for ITerior 2015 conference check
http://iterior.com.br
Scalone
November 17, 2015
Tweet
Share
More Decks by Scalone
See All by Scalone
TDD - Test Driven Development
scalone
0
3
Ruby, Web and IOT with the same Platform
scalone
0
98
20k mRuby devices in Production
scalone
0
440
DaFunk, IOT Framework in Ruby
scalone
0
160
Concurrency in the imperative and functional world
scalone
0
210
Git e Github
scalone
0
93
Git, o que é, do que é feito, para que serve?
scalone
0
340
DaFunk, IOT Framework in Ruby
scalone
0
200
Uzmenino Marketplace
scalone
0
130
Other Decks in Programming
See All in Programming
関数の挙動書き換える
takatofukui
4
770
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
1
1.4k
GeistFabrik and AI-augmented software development
adewale
PRO
0
250
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
310
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
390
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
170
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
730
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
260
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
4.1k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
400
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.3k
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
7.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
78
What's in a price? How to price your products and services
michaelherold
246
12k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
Writing Fast Ruby
sferik
630
62k
Documentation Writing (for coders)
carmenintech
76
5.2k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.1k
Mobile First: as difficult as doing things right
swwweet
225
10k
Fireside Chat
paigeccino
41
3.7k
Transcript
@Scalone Concurrency in the imperative and functional world
Thiago Scalone
[email protected]
@scalone
None
None
None
… nothing new … DISCLAIMER
If you don't understand concurrency… it isn’t problem if doesn't
make part of your day. DISCLAIMER
POINT
Context 1
None
… and the light …
None
None
None
None
None
None
Context 2
None
Concurrency
Concurrency Parallelism
“Dealing a lot of things at once Rob Pike about
Concurrency
“Doing a lot of things at once Rob Pike about
Parallelism
@Scalone
@Scalone
@Scalone
@Scalone
@Scalone
@Scalone
@Scalone
@Scalone
Context 3
Imperative
Imperative
Imperative defines computation as statements that change a program state
Imperative
Imperative
Functional
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional
Functional
Functional
Functional
Functional
Functional
None
Concurrency
Threads
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Java = Imperative
Thread and Locks I don't know the answer
Thread and Locks Mutable State
Thread and Locks Race condition
Race Condition the output is dependent on the sequence or
timing of other uncontrollable events
Thread and Locks The meaning of life is: 0
None
Thread and Locks The meaning of life is: 0
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks
Thread and Locks Optimization
Optimization the compiler is allowed to statically optimize your code
by reordering things
Optimization the compiler is allowed to statically optimize your code
by reordering things
Optimization the JVM is allowed to dynamically optimize your code
by reordering things
Optimization the JVM is allowed to dynamically optimize your code
by reordering things
Optimization the hardware you’re running on is allowed to optimize
performance by reordering things
Optimization the hardware you’re running on is allowed to optimize
performance by reordering things
Imperative
Imperative Thread Pool Mutual Exclusion Mutiple Locks - Deadlock Excessive
Contention
Functional
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional treats computation as the evaluation of mathematical functions and
avoids state and mutable data
Functional - Bound/Unbound Variable
Functional - Bound/Unbound Variable
Functional - Bound/Unbound Variable
Functional - Bound/Unbound Variable
Functional - Bound/Unbound Variable
Determinism
Determinism - Same In => Same out f(x)
Determinism - Same In => Same out no disk I/O
f(x)
Determinism - Same In => Same out no disk I/O
no random() f(x)
Determinism - Same In => Same out no disk I/O
no side effects no random() always the same result f(x)
Determinism - Same In => Same out no disk I/O
no side effects no random() f(x)
Determinism
Determinism
Determinism 42
Determinism
Determinism + Concurrency
Determinism + Concurrency
Determinism + Concurrency
Determinism + Concurrency
Determinism + Concurrency
Concurrency Models
Actor
Actor
Actor An object which encapsulates state and communicates with other
actors by exchaging messages
Actor accumulator
Actor accumulator
Goroutines and Channels
Goroutines and Channels
Microthreads with a internal scheduler Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
Goroutines and Channels
References
References
References
THANK YOU! @Scalone