Search code examples
javascripthtmlcpuworker-thread

Does the HTML5 worker threads feature expose the number of cores on a machine?


I'm playing with HTML5 worker threads and I want to partition out some work according to available cores. Is there a way to get the number of cores on the machine from JavaScript?


Solution

  • You can try to estimate the number of cores with: https://github.com/oftn/core-estimator

    demo: http://eligrey.com/blog/post/cpu-core-estimation-with-javascript