diff options
Diffstat (limited to 'files/es/orphaned/web/api/navigatorconcurrenthardware')
-rw-r--r-- | files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html | 70 | ||||
-rw-r--r-- | files/es/orphaned/web/api/navigatorconcurrenthardware/index.html | 72 |
2 files changed, 142 insertions, 0 deletions
diff --git a/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html new file mode 100644 index 0000000000..d43e59b609 --- /dev/null +++ b/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html @@ -0,0 +1,70 @@ +--- +title: navigator.hardwareConcurrency +slug: orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency +translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +original_slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +--- +<p>{{APIRef("HTML DOM")}}</p> + +<p>{{AvailableInWorkers}}</p> + +<p>La propiedad <code><strong>navigator.hardwareConcurrency </strong></code>es de solo lectura navigator.hardwareConcurrency devuelve el número de procesadores lógicos disponibles para ejecutar subprocesos en la computadora del usuario.</p> + +<h2 id="Sintaxi">Sintaxi</h2> + +<pre class="syntaxbox"><em>logicalProcessors</em> = window.navigator.hardwareConcurrency +</pre> + +<h2 id="Valor">Valor</h2> + +<p>{{jsxref("Number")}} <span class="tlid-translation translation" lang="es"><span title="">indica el número de núcleos de procesadores lógicos.</span></span></p> + +<p><span class="tlid-translation translation" lang="es"><span title="">Las computadoras modernas tienen múltiples núcleos de procesadores físicos en su CPU (dos o cuatro núcleos son típicos), pero cada núcleo físico también puede ejecutar más de un subproceso a la vez utilizando técnicas avanzadas de programación.</span> <span title="">Por lo tanto, una CPU de cuatro núcleos puede ofrecer ocho núcleos de procesador lógico, por ejemplo.</span> <span title="">El número de núcleos de procesador lógico se puede utilizar para medir el número de subprocesos que se pueden ejecutar de manera efectiva a la vez sin que tengan que cambiar de contexto.</span></span></p> + +<p> <span class="tlid-translation translation" lang="es"><span title="">Sin embargo, el navegador puede optar por informar un número menor de núcleos lógicos para representar con mayor precisión el número de </span></span>{{domxref("Worker")}}s<span class="tlid-translation translation" lang="es"><span title=""> que pueden ejecutarse a la vez, así que no trate esto como una medida absoluta del número de núcleos en el sistema del usuario</span> <span title="">.</span></span></p> + +<h2 id="Ejemplos">Ejemplos</h2> + +<p>En este ejemplo, se crea un {{domxref ("Worker")}} para cada procesador lógico informado por el navegador y se crea un registro que incluye una referencia al nuevo worker, así como un valor booleano que indica si nosotros ' estoy usando ese worker todavía; Estos objetos, a su vez, se almacenan en una matriz para su uso posterior. Esto crea un grupo de workers que podemos usar para procesar solicitudes más adelante.</p> + +<pre class="brush: js">let workerList = []; + +for (let i = 0; i < window.navigator.hardwareConcurrency; i++) { + let newWorker = { + worker: new Worker('cpuworker.js'), + inUse: false + }; + workerList.push(newWorker); +}</pre> + +<h2 id="Specification">Specification</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', '#dom-navigator-hardwareconcurrency', 'navigator.hardwareConcurrency')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> + + +<p>{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}</p> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{domxref("Navigator")}}</li> + <li>{{domxref("WorkerNavigator")}}</li> +</ul> diff --git a/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html b/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html new file mode 100644 index 0000000000..43e5ae1965 --- /dev/null +++ b/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html @@ -0,0 +1,72 @@ +--- +title: NavigatorConcurrentHardware +slug: orphaned/Web/API/NavigatorConcurrentHardware +tags: + - API + - Concurrency + - HTML DOM + - Interface + - Navigator + - NavigatorCPU + - NavigatorConcurrentHardware + - NeedsBrowserCompatibility + - NeedsTranslation + - Reference + - Threading + - Threads + - TopicStub + - WorkerNavigator + - Workers +translation_of: Web/API/NavigatorConcurrentHardware +original_slug: Web/API/NavigatorConcurrentHardware +--- +<p>{{APIRef("HTML DOM")}}</p> + +<p>The <strong><code>NavigatorConcurrentHardware</code></strong> {{Glossary("mixin")}} adds to the {{domxref("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.</p> + +<p>{{AvailableInWorkers}}</p> + +<p>The number of <strong>logical processor cores</strong> 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 {{domxref("Worker")}}s that can run at once</p> + +<h2 id="Properties">Properties</h2> + +<dl> + <dt>{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}</dt> + <dd>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.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<p><em>The <code>NavigatorConcurrentHardware</code></em><em> mixin has no methods.</em></p> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.NavigatorConcurrentHardware")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{domxref("Navigator")}}</li> + <li>{{domxref("WorkerNavigator")}}</li> +</ul> |