Urgent.News

What's breaking now, across thousands of outlets.

Tech

Breaking the Single-Threaded Barrier: How AtollJS Brings True Multithreading and Shared Memory to Modern JavaScript

JavaScript has had workers for fifteen years, and the way most apps use them hasn't changed: pick the expensive function, post it some data, await the result. That works, until the work isn't a function call. It's a million-row scan. It's a UI tree re-rendering every frame. It's state that both threads need live , not cloned-and-stale. AtollJS is built around four goals, each one a layer: 1.…

For over a decade, JavaScript workers have been available, yet modern apps have continued to employ them in much the same way: identifying an intensive function, sending it data, and awaiting the outcome. This approach works, but stumbles when the task at hand isn't a simple function call. It might be a task such as scanning a million rows of data, re-rendering a UI tree with every frame, or dealing with state that requires real-time updates from both threads, rather than stale, cloned data.

AtollJS is designed around four core principles, each serving as a layer in its architecture. The first principle is to share state rather than serialize it, as postMessage clones everything, which is excellent for results but not so great for continuously updating state. The second option, SharedArrayBuffer, is fast but doesn't provide a mechanism to ensure both sides are in sync.

To address this, AtollJS introduces a type. defineSharedMemory takes a specification of fixed-width fields and compiles it into a consistent byte layout, ensuring a single source of offsets for both the main thread and the worker. Importantly, this process requires no additional dependencies, as the schema engine is included within the SDK.

The second principle focuses on making worker calls feel like method calls. A worker is essentially an RPC surface, and defineWorker allows the declaration of method lists within the worker. connectWorker provides the main thread with a typed proxy over a lazily-spawned pool. This means that workers can be treated like regular methods, simplifying the interaction between the main thread and the worker.

The third principle enables results to flow back as reactivity. With shared memory, updates made by the worker can be observed by the main thread without the need for await statements. This is achieved through observe and defineTask, which allow components to subscribe to changes in shared memory, triggering updates as needed.

Finally, AtollJS allows for the rendering of UI off-thread. This means that entire applications can be pushed to the worker, where they can run in a separate thread and update the UI in real-time. The framework also supports islands, which can be mounted inside a worker to render applications within its context. This enables a seamless integration of UI rendering within the worker environment, offering a powerful tool for developers looking to optimize their JavaScript applications.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The explanation was right. The policy ID was wrong.

This is a submission for the Kaggle Benchmarking Challenge . What I Benchmarked A support model told me the correct fee, named the applicable policy in its explanation, and then put a different policy…

  • Support model provided correct fee and policy.
  • Policy ID in sourceids field was incorrect.
  • GPT-5.4-mini passed 26 of 30 pairs, Gemini-3.7-flash passed all 15.

기술 튜토리얼 게시 전 링크 점검

기술 튜토리얼의 링크 점검과 관리 기술 튜토리얼은 설명이 명확하고 화면 구성이 깔끔해도 링크 품질이 낮으면 전체적인 사용 경험이 크게 달라질 수 있습니다. 설치 과정을 따라가던 독자가 패키지 문서, API 레퍼런스, 설정 안내를 차례로 확인하는 과정에서 오래된 페이지나 로그인 전용 문서를 만나면 흐름이 끊깁니다.

  • Link checking essential before publishing technical tutorials
  • Poor link quality disrupts user experience during installation process
  • Categorize links into official, community, example, background sources

More from Thursday 1 October →