Concurrency with Clojure
summary
Workshop shows concrete Clojure concurrency patterns and tradeoffs: futures/promises, atoms produce compare-and-swap semantics, vars race (examples show b counts like 1941/1867/1859 under races) vs atoms giving 2000 with swap!, and refs via STM guarantee coordinated writes but retry under contention is costly. It builds a thundering‑herd fix using refs+promises that drops DB hits from hundreds to single digits then to one by having waiting threads dref/promise, and explores core.async channels, go/chan/alts/timeouts/merge/pubsub for pipelining and backpressure.
AI-written summary · about
chapters (25)
- 0:00Start
- 1:31Concurrency Workshop
- 5:58Parallelism versus Concurrency
- 20:45Define an Atom
- 32:21Build a Solution to Thundering Herd Problem
- 1:04:27Second Assignment
- 1:16:57Circuit Breaker Pattern
- 1:20:29Communicating Sequential Processes
- 1:22:03Concurrency Pattern
- 1:22:44Walkthrough
- 1:25:39Port Signature
- 1:36:28Can You Make an Infinitely Buffered Channel
- 1:38:42Timeout Channel
- 1:52:56What Is the Difference between Using Future and Using Async
- 2:04:47Parking Operations
- 2:09:33Thread Api
- 2:09:55Buffer Channels
- 2:10:35Sliding Buffer
- 2:12:00Dropping Buffer
- 2:14:23Transparent Buffer
- 2:17:08Recap
- 2:22:08The Risk of Data Loss
- 2:26:21Merge
- 2:36:33Subscriber Channels
- 2:44:11Add Mix Api
related talks
39mLet's talk concurrency
30mCONQUERING CONCURRENCY WITH FUNCTIONAL PROGRAMMING
44mConcurrency in Scala and on the JVM
52mSTM and Structured Concurrency — The Battle with Multithreading Dragons
01h 16mConcurrency Approaches: Past, Present, and Future
26mConcurrency primitives of Golang - how to use and how not to
48mConcurrency: It’s Harder (and Easier) Than You Think
50mFlavors of Concurrency in Java
