Plastic Shovels in a Multithreaded Sandbox
summary
Explains how multithreading is implemented in JavaScript by covering Atomics and Transferable Objects and demonstrating synchronization patterns like Semaphore and Mutex. Shows practical examples and custom implementations (referred to as small projects or ‘cosmolets and bicycles’) to illustrate those patterns.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 3:12Browser and JS main thread
- 4:16Long tasks and page hangs
- 5:40Web Workers for optimization
- 7:05Web Worker vs Shared Worker
- 9:34When to use Shared Workers
- 10:39Creating Shared Workers
- 12:29GitHub Shared Worker case
- 13:54Transferring object ownership
- 16:24Thread-safe state issues
- 17:52SharedArrayBuffer libraries
- 18:36Object Buffer in practice
- 20:01Simplifying Workers with Comlink
- 20:45Cross-Origin Isolation limits
- 21:27Race condition and Atomics fix
- 24:21Mutexes with Atomics
- 26:11SharedArrayBuffer vs ArrayBuffer
- 27:13Workers recap and takeaways
- 31:30Q&A
- 34:07Shared Memory in JS
- 36:35Atomics in real scenarios
- 37:41TypeScript with Workers
- 38:23SharedArrayBuffer standards
- 39:26WebAssembly and Workers
- 41:17Worker creation limits
- 42:50Q&A
related talks
24mShared Memory & Parallel Programming with JavaScript
32mMulticore JavaScript: Past, Present and Future
26mMulti-threading JavaScript
36mMulti-thread demystified
23mMultithreading in Javascript
04mDevelopment of JavaScript applications
28mKeep the Main Thread Free With Web Workers
41mConcurrency and Parallel Computing in JavaScript
