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
0
180
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
99
20k mRuby devices in Production
scalone
0
450
DaFunk, IOT Framework in Ruby
scalone
0
170
Concurrency in the imperative and functional world
scalone
0
220
Git e Github
scalone
0
100
Git, o que é, do que é feito, para que serve?
scalone
0
340
DaFunk, IOT Framework in Ruby
scalone
0
210
Uzmenino Marketplace
scalone
0
150
Other Decks in Programming
See All in Programming
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
CSC307 Lecture 01
javiergs
PRO
0
690
MUSUBIXとは
nahisaho
0
140
CSC307 Lecture 06
javiergs
PRO
0
690
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
CSC307 Lecture 10
javiergs
PRO
1
660
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
86
A designer walks into a library…
pauljervisheath
210
24k
Exploring anti-patterns in Rails
aemeredith
2
250
Context Engineering - Making Every Token Count
addyosmani
9
660
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
For a Future-Friendly Web
brad_frost
182
10k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
69
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