help icon indicating copy to clipboard operation
help copied to clipboard

My computer's CPU is AMD 9754, with 128 cores and 256 logic processors. But why does nodejs get 64 through os. cpu(). length? How to obtain the correct logical processor

Open wangzhiguoengineer opened this issue 1 year ago • 6 comments

Node.js Version

v22.3.0

NPM Version

10.8.1

Operating System

Windows 11 Professional Workstation Edition

Subsystem

child_process, cluster, v8

Description

My computer's CPU is AMD 9754, with 128 cores and 256 logic processors. But why does nodejs get 64 through os. cpu(). length? How to obtain the correct logical processor

Minimal Reproduction

import os from 'os'
console.log(os.cpus().length)

Output

image

image

Before You Submit

  • [X] I have looked for issues that already exist before submitting this
  • [X] My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask

wangzhiguoengineer avatar Jul 03 '24 14:07 wangzhiguoengineer