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
Core.async
Search
Peter Brachwitz
September 18, 2014
Programming
0
52
Core.async
Introduction to core.async with some remarks on concurrency models in general
Peter Brachwitz
September 18, 2014
Tweet
Share
More Decks by Peter Brachwitz
See All by Peter Brachwitz
Om/React.js/Clojurescript: An introduction
pebrc
1
290
Introduction to Clojure for Java Devs
pebrc
1
68
Other Decks in Programming
See All in Programming
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
XStateでReactに秩序を与えたい
gizm000
0
730
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
160
A New Era of Testing
mannodermaus
2
500
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
250
Modern Angular with the NGRX Signal Store New Rules for Your Architecture @BASTA! 2024 in Mainz
manfredsteyer
PRO
0
120
サーバーレスで負荷試験!Step Functions + Lambdaを使ったk6の分散実行
shuntakahashi
6
1.6k
Debugging: All you need to know (for simultaneous interpreting)
jmatsu
2
790
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
640
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
550
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
4
90k
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
41
6.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
In The Pink: A Labor of Love
frogandcode
139
22k
Design by the Numbers
sachag
277
19k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
190
16k
Docker and Python
trallard
39
3k
KATA
mclloyd
27
13k
Navigating Team Friction
lara
183
13k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
502
140k
Building Better People: How to give real-time feedback that sticks.
wjessup
359
19k
Transcript
CORE.ASYNC WITH SOME REMARKS ON CONCURRENCY MODELS IN GENERAL /
Peter Brachwitz @p_brc
AGENDA 1. Popular concurrency models in comparison [15 min.] 2.
A taste of core.async [15 min]
WHY? We want to be more 'reactive' (we can discuss
whether 'reactive' is a 'thing' later) We want to make use of our multi-core hardware Low-level concurrency is hard
WHAT? Definitions: Concurrency vs. parallelism and what about multi-core Here:
'processes' working together in a meaningful manner
APPROACHES TO CONCURRENT PROGRAMMING 1. Shared memory: Threads and locks
* 2. Message passing: 1. Actors 2. CSP
WHAT NOT (TODAY)? Refs Atoms Agents Futures, Delays
SHARED MEMORY, THREADS AND LOCKS 'Location based programming' (R. Hickey)
Naive approaches don't scale very well. Think: web server using a thread per request. Hard to reason about, error-prone
MITIGATION: EVENT-LOOP ARCHITECTURE Single-threaded, non-blocking Handle blocking or time-consuming computations
in different execution contexts Handle the completion of these computations via callbacks (callback hell)
THE ACTOR MODEL [originally] Hewitt, Bishop, Steiger 1973
'Objects' communicating via messages Sequencing of messages via actor-local queues
('mailbox') You need to know your peer No inherent back-pressure (can be implemented on application level)
CSP [originally] Hoare 1978
CSP in core.async flavour Channels as conveyor belts between 'processes'
Sequential looking asynchrony via go blocks Channels are bounded: back pressure Not for distributed computing: everything within one VM
COMPARISON WITH ACTOR SYSTEMS Anonymity vs. Identity Rendezvous vs. Asynchrony
Explicit vs. implicit 'channels' Local vs. Distributed
LET'S LOOK AT SOME CODE!
SOURCES core.async on Github Tim Baldrige's Clojure Conj 2013 talk
Rich Hickey speaking at Strange Loop 2013 Gul Agha's dissertation