"Concurrency & Parallelism in JS" by Naveed Ihsanullah
(video)
- Concurrency & parallelism
- Concurrency is having multiple tasks run together (multitasking)
- Parallelism is actually executing tasks separately (in hardware)
- Browser implementations of JS is fast and getting faster with asm.js etc
- Parallelism is bottlenecked by the hardware, and concurrency is bottlenecked by waiting on responses.
- Improving parallelism
- Improving concurrency
- Parallel JS -- still experimental etc
postMessage()
-- performance isn't there- transfer buffers around
- Native has solved this. Do similar on the web: shared memory for JS
postMessage()
+SharedArrayBuffer
- use
SharedInt32Array
to view on it - the low-level details can be abstracted
- Availability
- Landed in Firefox Nightly.
- Announced for future Chrome too.
- Unfortunately can't be polyfilled.