← All posts

Category

Concurrency

8 posts

Function Coloring comparison: on the left, without Effect, the sync world (render, buildApp, readFile) cascades into a forced async world as soon as one function becomes asynchronous; on the right, with Effect, a single world where Effect<A, E, R> composes readFile, parseConfig and handleError identically, the runtime choosing sync or async.

Function coloring: when sync and async become an implementation detail

The Function Coloring problem between sync and async functions, and how Effect Systems like Effect [...]

Worker Threads: run CPU-intensive tasks without blocking the Event Loop

How to offload CPU-intensive tasks with Node.js Worker Threads without degrading the Event Loop [...]

Blocking vs non-blocking: mastering Event Loop performance

Understanding Blocking and Non-Blocking in Node.js: the Reactor Pattern, Event Loop, thread pools [...]

Concurrency: why abstractions are not enough

Callbacks, Promises, Fibers, Coroutines reduce complexity but don't eliminate resource leaks and [...]

Comparison of two models for handling I/O concurrency: on the left, the one-connection-one-thread model where N connections consume N threads via a dynamic thread pool; on the right, the Event Loop model where N connections share a single main thread backed by a fixed-size thread pool.

Concurrency: handling I/O with threads is a leaky abstraction

From Ryan Dahl's diagnosis to the birth of Node.js: why the Event Loop is an alternative to the [...]

Two code blocks illustrating the Zalgo anti-pattern: a releaseZalgo function that invokes its callback either synchronously or asynchronously depending on a condition, and the calling code for which the execution order of 'Before', 'Done' and 'After' becomes impossible to determine.

Callbacks: the Zalgo anti-pattern, never mix sync and async

Why a callback that is both synchronous and asynchronous is an anti-pattern (Zalgo) [...]

Callbacks: a callback isn't necessarily async

Demystifying callbacks in JavaScript: the difference between synchronous and asynchronous [...]

Promises and resource management: the interruption problem

The little-known flaw in Promises: their non-interruptible nature prevents resources from being [...]