Clone in a terminal:
index.js
examples/raytrace-parallel/static/ - Remove thread pool and provide a single function for spawning new threads commit 2759560
function loadWasm() {
  if (typeof SharedArrayBuffer !== 'function') {
    console.error('this browser does not have SharedArrayBuffer support enabled' + '\n\n' + msg);
    return
  }
  // Test for bulk memory operations with passive data segments
  //  (module (memory 1) (data passive ""))
  const buf = new Uint8Array([0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,
    0x05, 0x03, 0x01, 0x00, 0x01, 0x0b, 0x03, 0x01, 0x01, 0x00]);
  if (!WebAssembly.validate(buf)) {
    console.error('This browser does not support passive Wasm memory, Background threads will not work' + '\n\n' + msg);
    return
  }

  wasm_bindgen()
    .catch(console.error);
}

loadWasm();

File history (2 commits)

2145271 Johan Mattsson - johan.mattsson.m@gmail.com
Remove thread pool and provide a single function for spawning new threads
Remove thread pool and provide a single function for spawning new threads
2759560 Johan Mattsson - johan.mattsson.m@gmail.com
Multiple wasm threads
Multiple wasm threads

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112