Scheduler helpers (in #include <mrpt/system/scheduler.h>)

// enums

enum mrpt::system::TProcessPriority;
enum mrpt::system::TThreadPriority;

// global functions

void mrpt::system::changeCurrentThreadPriority(TThreadPriority priority);
void mrpt::system::changeCurrentProcessPriority(TProcessPriority priority);

Global Functions

void mrpt::system::changeCurrentThreadPriority(TThreadPriority priority)

Change the priority of the current thread - for Windows, see also changeCurrentProcessPriority()

  • Windows: This is equivalent to SetThreadPriority() (read the docs there)

  • Linux (pthreads): May require root permissions! This sets the Round Robin scheduler with the given priority level. Read sched_setscheduler.

See also:

createThread, changeCurrentProcessPriority, changeCurrentThreadPriority

void mrpt::system::changeCurrentProcessPriority(TProcessPriority priority)

Change the priority of the given process (it applies to all the threads, plus independent modifiers for each thread).

  • Windows: See SetPriorityClass

  • Linux (pthreads): Requires root permissions to increase process priority! Internally it calls nice(), so it has no effect if () was called and a SCHED_RR is already active.

See also:

createThread, changeThreadPriority