[][src]Function deno_plugin_num_cpus::op_num_cpus

pub fn op_num_cpus(
    _interface: &mut dyn Interface,
    _zero_copy: &mut [ZeroCopyBuf]
) -> Op

Get the number of CPUs available on the current system.

Use in Deno:

const { op_num_cpus } = Deno.core.ops();
const response: Uint8Array = Deno.core.dispatch(op_num_cpus)!;

Returned Binary Layout:

+----------------+----------------+----------------+----------------+
|   NUM_CPUS (8) |                |                |                |
+----------------+----------------+----------------+----------------+

The number of cpu on each machine will not be greater than 256(2^8), so we use 1 byte to pass the return value.