Documentation
¶
Index ¶
Constants ¶
View Source
const CacheLineSize = max( int(unsafe.Sizeof(cpu.CacheLinePad{})), 64-65*int(unsafe.Sizeof(cpu.CacheLinePad{})), )
CacheLineSize is the size of a CPU cache line in bytes, or a non-zero estimate if the size is unknown.
Variables ¶
This section is empty.
Functions ¶
func NumCPU ¶
func NumCPU() int
NumCPU returns the number of logical CPUs usable by the current process.
!!Note!! If you are considering using this to scale parallelism with the machine size, use runtime.GOMAXPROCS(0) instead. The latter is better because GOMAXPROCS is reduced with certain test runs (with the race detector); it can also be reduced in containerized environments.
The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup are not reflected.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.