A Concurrency Model for JavaScript with Cooperative Cancellation
summary
Library-based concurrency model exposes thread ID passed via a reader-monad wrapper so threads are functions returning Promises and can be cancelled, paused, resumed cooperatively. Synchronization uses MVars and Channels to protect shared state and enable hierarchical cancellation (cancel parent cancels children). Paper ships a formal semantics and a demo: a data‑streaming app with four threads and three channels (pause/resume per chart, single-stop kills all). Measured runtime shows significant sync overhead but negligible additional cost for asynchronous workloads.
AI-written summary · about
chapters (9)
- 0:00Outline
- 1:55Motivation : concurrency error
- 3:45Motivation : Promise doesn't help
- 4:21Motivation : prevent concurrency error with locks
- 6:53Thread model : prevent concurrency error with locks
- 9:41Thread model:enable cancellation
- 10:47Thread model: cancel from another thread
- 11:37Application: data streaming
- 14:38Runtime overhead
related talks
33mTaming the Asynchronous Beast with CSP Channels in JavaScript
46mTaming the Asynchronous Beast with CSP Channels in JavaScript
36mWriting Sound Asynchronous Code with Coroutines
30mParadigms for dealing with asynchrony
42mBeyond Promises: Async Patterns in JavaScript
28mAsynchronous JavaScript & PureScript for Haskellers
33mAsync patterns to scale your multicore JavaScript elegantly.
01h 04m5 architectures of asynchronous JavaScript
