Documentation
¶
Index ¶
Constants ¶
View Source
const ( UnixPriorityIdle = 19 UnixPriorityBelowNormal = 5 UnixPriorityNormal = 0 UnixPriorityAboveNormal = -5 UnixPriorityHigh = -10 UnixPriorityRealTime = -20 )
Opiniated nice values
Variables ¶
This section is empty.
Functions ¶
func GetRAW ¶
GetRAW is an OS specific function to get the priority of a process. As priority values are not the same on all OSes, you should use the universal function Get() instead to be platform agnostic.
func Set ¶
func Set(pid int, priority ProcessPriority) (err error)
Set is an universal wrapper for setting process priority. It uses OS specific convertion and calls OS specific implementation.
Types ¶
type ProcessPriority ¶
type ProcessPriority int
ProcessPriority is a universal type for process priorities. It used with the universal wrapper Set() to be platform agnostic.
const ( // PriorityOSSpecific is only used on Get(), it indicates that the current level is not a universal one from this package. OSSpecific ProcessPriority = iota Idle BelowNormal Normal AboveNormal High RealTime )
func Get ¶
func Get(pid int) (priority ProcessPriority, rawOSPriority int, err error)
Get is an universal wrapper for getting process priority. It uses OS specific convertion and calls OS specific implementation.
func (ProcessPriority) String ¶
func (pp ProcessPriority) String() string
String implements the fmt.Stringer interface
Click to show internal directories.
Click to hide internal directories.