Skip to content

Commit 7481de0

Browse files
Change start WW id value in hybrid threading mode (#26660)
Linux TID/PID values have a max limit of 4,194,304. We should mimic that and start WW id at 4,194,304/2.
1 parent 03c9ee7 commit 7481de0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib/libwasm_worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ addToLibrary({
6565
#if PTHREADS
6666
// When the build contains both pthreads and Wasm Workers, offset the
6767
// Wasm Worker ID space to avoid collisions with pthread TIDs (which start
68-
// at 42). We use `1 << 30` since it's ~1/2 way through `pid_t` space,
68+
// at 42). We use `1 << 21` since it's ~1/2 way through `pid_t` space,
6969
// essentially giving pthreads the first 1/2 of the range and wasm workers the
7070
// second half.
71-
$_wasmWorkersID: {{{ 1 << 30 }}},
71+
$_wasmWorkersID: {{{ 1 << 21 }}},
7272
#else
7373
$_wasmWorkersID: 1,
7474
#endif

0 commit comments

Comments
 (0)