Platforms to show: All Mac Windows Linux Cross-Platform

SetQOSClassMBS(QOS as Integer) as Integer   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method System MBS Util Plugin 26.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the Quality Of Service class for the current thread.
Example
const QOS_CLASS_USER_INTERACTIVE = 5
const QOS_CLASS_USER_INITIATED = 4
const QOS_CLASS_DEFAULT = 3
const QOS_CLASS_UTILITY = 2
const QOS_CLASS_BACKGROUND = 1
const QOS_CLASS_UNSPECIFIED = 0

var e as integer = SetQOSClassMBS(QOS_CLASS_BACKGROUND)

The Quality Of Service class for a thread tells the scheduler how to prioritize the thread and whether to run this on a faster or more efficient CPU core.

MacOS can run threads marked as background on an efficient core to safe battery life.
Linux does not allow to set higher priority (4 or 5) unless you have permissions to do so.

Returns a native error code or zero in case of success.

NameValueDescription
QOS_CLASS_USER_INTERACTIVE5The thread handles user input.
QOS_CLASS_USER_INITIATED4The user requested this action.
QOS_CLASS_DEFAULT3Default
QOS_CLASS_UTILITY2Utility thread running with reduced priority, e.g. menubar utility app.
QOS_CLASS_BACKGROUND1Background thread with reduced priority, e.g. backup.
QOS_CLASS_UNSPECIFIED0Unknown level.

Some examples using this global method:

Blog Entries

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...