Bun has an open PR adding shared-memory threads to JavaScriptCore
Key takeaways
- There was an error while loading.
- Status: parallel JavaScript executes, through all four JIT tiers, with no global lock — and the thread test suite now passes that way.
- A thread is a function call on another core:
There was an error while loading. Please reload this page.
Copy link Copy Markdown Collaborator What this is Shared-memory threads for JavaScriptCore. new Thread(fn) runs fn on another thread, in the same heap, with the same objects. No structured clone, no message passing, no SharedArrayBuffer-only escape hatch. You share an object by sharing the object.
Status: parallel JavaScript executes, through all four JIT tiers, with no global lock — and the thread test suite now passes that way. It is not done: thread-sanitizer cleanup, fuzzing, one benchmark over budget, and a long soak stand between "tests pass" and anything more. The locked fallback mode and the threads-disabled configuration remain untouched and verified. The bring-up log at the bottom is honest about what broke and what it took. This PR exists so the design and the code can be read and argued with. It may never merge.