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

fix: default minThreads with odd CPU count #457

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix default minThreads with odd CPU count
If not, Piscina will create and remove the latest worker indefinitely
  • Loading branch information
Chocobozzz authored Nov 28, 2023
commit 7d28a05b52688d23f6f0ddb9310cf8227d5761c8
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ interface FilledOptions extends Options {
const kDefaultOptions : FilledOptions = {
filename: null,
name: 'default',
minThreads: Math.max(cpuCount / 2, 1),
minThreads: Math.max(Math.floor(cpuCount / 2), 1),
maxThreads: cpuCount * 1.5,
idleTimeout: 0,
maxQueue: Infinity,
Expand Down