gomaxprocs

package
v0.0.0-...-5c0fc10 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package gomaxprocs synchronizes adjustments to GOMAXPROCS. When this package is active (i.e. after the first call to SetBase), it sets the value of GOMAXPROCS to a "base" value (which should be set by a single goroutine, without races) plus a non-negative "temporary" value (which may be concurrently increased or decreased by multiple goroutines).

Note that changing GOMAXPROCS stops the world, so callers should adjust GOMAXPROCS infrequently.

TODO: Add gomaxprocs.Get() and check that other gVisor packages don't call runtime.GOMAXPROCS() at all.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(n int)

Add adds n temporary GOMAXPROCS. n may be negative; callers should call Add with negative n to remove temporary GOMAXPROCS when they are no longer needed.

func SetBase

func SetBase(n int)

SetBase sets base GOMAXPROCS.

Types

This section is empty.

Jump to

Keyboard shortcuts

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