system

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 3 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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