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
50
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
66
Other Decks in Programming
See All in Programming
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
210
Code Reviews
bkuhlmann
4
890
Git Rebase
bkuhlmann
11
1.6k
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
1
180
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Elm Form Validation
bkuhlmann
0
510
Hanami and htmx
bkuhlmann
0
210
Rethinking UI building strategies @ SFI 2024
letelete
0
270
Snowflakeで眠ったデータを起こそう!
estie
0
120
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
710
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
8
2.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
In The Pink: A Labor of Love
frogandcode
138
21k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
How to name files
jennybc
65
93k
Building Your Own Lightsaber
phodgson
99
5.7k
Producing Creativity
orderedlist
PRO
337
39k
Music & Morning Musume
bryan
41
5.6k
Stop Working from a Prison Cell
hatefulcrawdad
266
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