Skip to content
ISBN: B0HNLT33HV
ISBN13: 9798163770656

Beyond the Main Thread: Workers, Shared Memory and Scheduling for JavaScript in the Browser

$25.00List Price: $25.00
ISBN: B0HNLT33HV
ISBN13: 9798163770656
Formats

Conditions

A brand-new, unused copy in perfect condition.

Formats

Conditions

A brand-new, unused copy in perfect condition.

See all 1 editionsfrom $25.00

Book Overview

A page freezes when one long task holds the main thread. This book covers the browser's tools for keeping that work out of the way: dedicated, shared and service workers, OffscreenCanvas, SharedArrayBuffer and Atomics, WebAssembly threads, the Scheduler API, the Origin Private File System, and Observables.

Each chapter explains one tool, shows where it is used, and builds a demo you can run. The timings come from measurements in real Chrome, and the code is in a download that goes with the book. Where a result was surprising, the book says so: plain JavaScript beat our hand-written WebAssembly on a single thread, and moving work to a worker didn't make it faster at all.

Some of what the demos measure

  • A 1.5-second job that freezes the page on the main thread, and the same job in a worker
  • Four workers losing more than half their updates to one shared counter
  • A crashed tab noticed in about 200 ms, where a pagehide handler never noticed
  • Eight threads rendering about six times faster than one, and a fixed split of the work taking twice as long as a shared counter
  • 20,000 small file writes in about 70 ms instead of about 3.5 seconds

Who this book is for

Web developers who know JavaScript and want to keep their pages responsive. You don't need to have used workers or shared memory before.

Format:
Paperback
Language:
English
ISBN:
B0HNLT33HV
ISBN13:
9798163770656
Release Date:
October 2026
Publisher:
Independently Published
Length:
142 Pages
Weight:
0.56 lbs.
Dimensions:
0.3″ × 7.5″ × 9.3″
ComputersComputers & Technology

Customer Reviews

0 customer ratings | 0 reviews
Write a Review

There are currently no reviews. Be the first to review this work.