[H3] Thread pool never receives its task list - multithreading is a no-op #21

Closed
opened 2026-06-27 03:54:47 +00:00 by sessamekesh · 1 comment
Owner

File: wasm/src/bindings.cc:50-55

create_thread_pool takes exec_task_list but never uses it:

auto create_thread_pool(std::shared_ptr<igasync::TaskList> exec_task_list) {
  igasync::ThreadPool::Desc thread_pool_desc{};
  thread_pool_desc.AdditionalThreads = -1;
  return igasync::ThreadPool::Create(thread_pool_desc);  // exec_task_list ignored
}

ThreadPool::add_task_list is bound (bindings.cc:72) but never called from JS — IgviewerContext.tsx:227 just does CreateThreadPool(execTaskList).

Impact: in "multi" mode the pool spins up workers that pull from no task list, and all exec work still runs on the main thread via the rAF pump (IgviewerContext.tsx:246). The MT build pays the full COOP/COEP/SharedArrayBuffer cost for zero parallelism.

Fix: wire exec_task_list into the pool (e.g. call add_task_list(exec_task_list) inside create_thread_pool, or from the JS init).


Filed by an automated AI code review (manual proof-of-concept run). Code locations reference the various-cleanup branch.

**File:** `wasm/src/bindings.cc:50-55` `create_thread_pool` takes `exec_task_list` but never uses it: ```cpp auto create_thread_pool(std::shared_ptr<igasync::TaskList> exec_task_list) { igasync::ThreadPool::Desc thread_pool_desc{}; thread_pool_desc.AdditionalThreads = -1; return igasync::ThreadPool::Create(thread_pool_desc); // exec_task_list ignored } ``` `ThreadPool::add_task_list` is bound (`bindings.cc:72`) but never called from JS — `IgviewerContext.tsx:227` just does `CreateThreadPool(execTaskList)`. **Impact:** in `"multi"` mode the pool spins up workers that pull from no task list, and all exec work still runs on the main thread via the rAF pump (`IgviewerContext.tsx:246`). The MT build pays the full COOP/COEP/SharedArrayBuffer cost for zero parallelism. **Fix:** wire `exec_task_list` into the pool (e.g. call `add_task_list(exec_task_list)` inside `create_thread_pool`, or from the JS init). --- _Filed by an automated AI code review (manual proof-of-concept run). Code locations reference the `various-cleanup` branch._
Author
Owner
Fixed in https://git.indigocode.dev/sessamekesh/igasset-viewer-react/pulls/40
Sign in to join this conversation.
No description provided.