sched

package
v0.0.0-...-ff2c174 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sched implements scheduler related features.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUSetSize

func CPUSetSize(num uint) uint

CPUSetSize returns the size in bytes of a CPUSet that can contain num cpus.

Types

type CPUSet

type CPUSet []byte

CPUSet contains a bitmap to record CPU information.

Note that this definition is only correct for little-endian architectures, since Linux's cpumask_t uses unsigned long.

func NewCPUSet

func NewCPUSet(num uint) CPUSet

NewCPUSet returns a CPUSet for the given number of CPUs which initially contains no CPUs.

func NewFullCPUSet

func NewFullCPUSet(num uint) CPUSet

NewFullCPUSet returns a CPUSet for the given number of CPUs, all of which are present in the set.

func (*CPUSet) ClearAbove

func (c *CPUSet) ClearAbove(cpu uint)

ClearAbove clears bits corresponding to cpu and all higher cpus.

func (CPUSet) Copy

func (c CPUSet) Copy() CPUSet

Copy returns a copy of the CPUSet.

func (CPUSet) ForEachCPU

func (c CPUSet) ForEachCPU(fn func(uint))

ForEachCPU iterates over the CPUSet and calls fn with the cpu index if it's set.

func (CPUSet) NumCPUs

func (c CPUSet) NumCPUs() uint

NumCPUs returns how many cpus are set in the CPUSet.

func (*CPUSet) Set

func (c *CPUSet) Set(cpu uint)

Set sets the bit corresponding to cpu.

func (CPUSet) Size

func (c CPUSet) Size() uint

Size returns the size of 'c' in bytes.

Jump to

Keyboard shortcuts

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