NavigatorConcurrentHardware

这篇翻译不完整。请帮忙从英语翻译这篇文章

The NavigatorConcurrentHardware mixin adds to the Navigator interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

Note: 此特性在 Web Worker 中可用。

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of Workers that can run at once

Properties

NavigatorConcurrentHardware.hardwareConcurrency 只读
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.

Methods

The NavigatorConcurrentHardware mixin has no methods.

Specifications

Specification Status Comment
HTML Living Standard
NavigatorConcurrentHardware
Living Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 37Edge Full support YesFirefox Full support 48IE ? Opera Full support 24Safari ? WebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 48Opera Android Full support 24Safari iOS ? Samsung Internet Android Full support Yes
Available in workersChrome Full support 37Edge ? Firefox ? IE ? Opera Full support 24Safari ? WebView Android Full support 37Chrome Android Full support 37Edge Mobile ? Firefox Android ? Opera Android Full support 24Safari iOS ? Samsung Internet Android Full support Yes
hardwareConcurrencyChrome Full support 37Edge Full support 15Firefox Full support 48IE ? Opera Full support 24Safari ? WebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 48Opera Android Full support 24Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also