Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reuseWorker strict mode #120

Merged
merged 10 commits into from
May 19, 2024
Merged

feat: reuseWorker strict mode #120

merged 10 commits into from
May 19, 2024

Conversation

toyobayashi
Copy link
Owner

https://emscripten.org/docs/tools_reference/settings_reference.html#pthread-pool-size

instantiateNapiModule({
  /**
   * equivalent to { size: 0, strict: false }
   */
  reuseWorker: true,

  reuseWorker: {
    size: 4, // equivalent to emscripten's PTHREAD_POOL_SIZE
    strict: true // equivalent to emscripten's PTHREAD_POOL_SIZE_STRICT=2
  }
})

If size > 0, only asynchronous loading API (instantiateNapiModule / loadNapiModule) can guarantee thread pool ready before emnapi initialization.

@toyobayashi
Copy link
Owner Author

nodejs/node#53036

@toyobayashi toyobayashi merged commit 696f3e8 into main May 19, 2024
7 checks passed
@toyobayashi toyobayashi deleted the improve-reuse-worker branch May 19, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant