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
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Core.async
Introduction to core.async with some remarks on concurrency models in general
Peter Brachwitz
September 18, 2014
More Decks by Peter Brachwitz
See All by Peter Brachwitz
Om/React.js/Clojurescript: An introduction
pebrc
1
300
Introduction to Clojure for Java Devs
pebrc
1
91
Other Decks in Programming
See All in Programming
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
150
Android CLI
fornewid
0
170
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.8k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
320
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
550
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
110
継続モナドとリアクティブプログラミング
yukikurage
3
640
Claude Team Plan導入・ガイド
tk3fftk
0
230
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
510
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
280
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
120
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
150
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
Code Reviewing Like a Champion
maltzj
528
40k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
810
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
460
KATA
mclloyd
PRO
35
15k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The untapped power of vector embeddings
frankvandijk
2
1.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
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