runtime

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 1 Imported by: 0

Documentation

Overview

 Package runtime counts the number of threads currently available to your process, without caching.

 Handy to dynamically adjust load in response to changing circumstances, such as hot-plugging of cpus or a changed cpu affinity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumCPU

func NumCPU() int

NumCPU queries the operating system for the count of threads available for use to this process, without caching.

Please note that you will still need to examine the underlying cpu topology,  i. e. to learn what datastructure will perform the best.  E. g., four available threads on a four-socket 32-core machine might span caches that are not shared.

Returns 0 on errors (extremely unlikely); try |runtime.NumCPU| in that case.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL