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
Concurrency in the imperative and functional world
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Scalone
November 17, 2015
Programming
180
0
Share
Concurrency in the imperative and functional world
Presentation created for ITerior 2015 conference check
http://iterior.com.br
Scalone
November 17, 2015
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
110
20k mRuby devices in Production
scalone
0
480
DaFunk, IOT Framework in Ruby
scalone
0
180
Concurrency in the imperative and functional world
scalone
0
230
Git e Github
scalone
0
110
Git, o que é, do que é feito, para que serve?
scalone
0
360
DaFunk, IOT Framework in Ruby
scalone
0
220
Uzmenino Marketplace
scalone
0
160
Other Decks in Programming
See All in Programming
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
2
360
AI Agent と正しく分析するための環境作り
yoshyum
2
550
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
140
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
430
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
190
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
980
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
460
AI時代になぜ書くのか
mutsumix
0
430
[BalkanRuby 2026] Drop your app/services!
palkan
3
600
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
1
160
My daily life on Ruby
a_matsuda
3
420
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How to make the Groovebox
asonas
2
2.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
180
How to train your dragon (web standard)
notwaldorf
97
6.6k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
300
We Have a Design System, Now What?
morganepeng
55
8.1k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
54k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
360
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
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