Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Core.async
Search
Peter Brachwitz
September 18, 2014
Programming
0
60
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
73
Other Decks in Programming
See All in Programming
connect-python: convenient protobuf RPC for Python
anuraaga
0
320
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
270
モデル駆動設計をやってみよう Modeling Forum2025ワークショップ/Let’s Try Model-Driven Design
haru860
0
210
Level up your Gemini CLI - D&D Style!
palladius
1
140
Rails Girls Sapporo 2ndの裏側―準備の日々から見えた、私が得たもの / SAPPORO ENGINEER BASE #11
lemonade_37
2
200
WebRTC と Rust と8K 60fps
tnoho
2
1.1k
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
3.1k
20 years of Symfony, what's next?
fabpot
2
150
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
490
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
550
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
110
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
7
3.1k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.5k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
RailsConf 2023
tenderlove
30
1.3k
The Cult of Friendly URLs
andyhume
79
6.7k
A Tale of Four Properties
chriscoyier
162
23k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Raft: Consensus for Rubyists
vanstee
140
7.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Optimizing for Happiness
mojombo
379
70k
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