ES proposal: Shared memory and atomics
The ECMAScript proposal “ Shared memory and atomics ” by Lars T. Hansen has reached stage 4 this week and will be part of ECMAScript 2017. It introduces a new constructor SharedArrayBuffer and a namespace object Atomics with helper functions. This blog post explains the details. Parallelism vs. concurrency Before we begin, let’s clarify two terms that are similar, yet distinct: “parallelism” and “concurrency”. Many definitions for them exist; I’m using them as follows: Parallelism (parallel vs. serial): execute multiple tasks simultaneously Concurrency (concurrent vs. sequential): execute several tasks during overlapping periods of time (and not one after another). Both are closely related, but not the same: Parallelism without concurrency: single instruction, multiple data (SIMD). Multiple computations happen in parallel, but only a single task (instruction) is executed at any given moment. Concurrency without parallelism: multitasking via time-sharing on a single-core CPU. However,...