priority

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Idle       = 19
	Background = 15
	Low        = 10
	Normal     = 0
	High       = -10
	Highest    = -20
)

Priority class. Can be used as a priority class in Windows, or as a "nice" value in unixes

View Source
const IOPrioClassShift = 13
View Source
const IOPrioMask = (1 << IOPrioClassShift) - 1

Variables

View Source
var (
	// Values is the map between the name and the value
	Values = map[string]int{
		"idle":       Idle,
		"background": Background,
		"low":        Low,
		"normal":     Normal,
		"high":       High,
		"highest":    Highest,
	}
)

Functions

func SetClass

func SetClass(class int) error

SetClass sets the priority class of the current process

func SetIONice

func SetIONice(class, value int) error

SetIONice sets the io_prio class and value

func SetNice

func SetNice(priority int) error

SetNice sets the unix "nice" value of the current process

Types

type IOPrioClass

type IOPrioClass int
const (
	IOPrioNoClass IOPrioClass = iota
	IOPrioClassRT
	IOPrioClassBE
	IOPrioClassIdle
)

IOPrioClass

func GetIONice

func GetIONice() (IOPrioClass, int, error)

GetIONice returns the io_prio class and value

type IOPrioWho

type IOPrioWho int
const (
	IOPrioWhoProcess IOPrioWho = iota + 1
	IOPrioWhoPGRP
	IOPrioWhoUser
)

IOPrioWho

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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