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
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
81
20k mRuby devices in Production
scalone
0
430
DaFunk, IOT Framework in Ruby
scalone
0
150
Concurrency in the imperative and functional world
scalone
0
190
Git e Github
scalone
0
85
Git, o que é, do que é feito, para que serve?
scalone
0
320
DaFunk, IOT Framework in Ruby
scalone
0
190
Uzmenino Marketplace
scalone
0
110
Other Decks in Programming
See All in Programming
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
17
6.1k
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
130
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
300
構文解析器入門
ydah
7
1.9k
ソフトウェア設計とAI技術の活用
masuda220
PRO
25
6.8k
フロントエンドのパフォーマンスチューニング
koukimiura
6
2.3k
Hack Claude Code with Claude Code
choplin
8
2.8k
AIともっと楽するE2Eテスト
myohei
9
3.1k
リッチエディターを安全に開発・運用するために
unachang113
1
250
Gemini CLIの"強み"を知る! Gemini CLIとClaude Codeを比較してみた!
kotahisafuru
2
180
AWS Summit Japan 2024と2025の比較/はじめてのKiro、今あなたは岐路に立つ
satoshi256kbyte
1
250
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
410
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Gamification - CAS2011
davidbonilla
81
5.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.3k
Speed Design
sergeychernyshev
32
1k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Rails Girls Zürich Keynote
gr2m
95
14k
GraphQLとの向き合い方2022年版
quramy
49
14k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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