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(nodejs): implement os.availableParallelism #5109

Merged

Conversation

WingLim
Copy link
Contributor

@WingLim WingLim commented Sep 12, 2023

What does this PR do?

Resolves #4986

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

@WingLim WingLim marked this pull request as draft September 12, 2023 15:14
@WingLim WingLim marked this pull request as ready for review September 12, 2023 15:41
@wooster0
Copy link
Contributor

std.Thread.getCpuCount?

@WingLim WingLim force-pushed the feat/support_os_availableParallelism branch from e1bc10a to 5ea5418 Compare September 12, 2023 17:49
src/bun.js/node/node_os.zig Outdated Show resolved Hide resolved
@Jarred-Sumner
Copy link
Collaborator

This can be done in JS. navigator.hardwareConcurrency exposes this information.

@WingLim WingLim requested a review from paperdave September 13, 2023 07:14
@Jarred-Sumner Jarred-Sumner merged commit 932fa35 into oven-sh:main Sep 14, 2023
@Jarred-Sumner
Copy link
Collaborator

Thank you

@WingLim WingLim deleted the feat/support_os_availableParallelism branch September 14, 2023 01:41
paperdave pushed a commit to SuperAuguste/bun that referenced this pull request Sep 18, 2023
* feat(nodejs): implement `os.availableParallelism`

* chore: do not throw error as same as node

* refactor: use `navigator.hardwareConcurrency`
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.

node:os availableParallelism() not implemented
4 participants