MRPT  2.0.4
scheduler.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 namespace mrpt::system
12 {
13 // clang-format off
14 /** \addtogroup mrpt_scheduler Scheduler helpers (in #include <mrpt/system/scheduler.h>)
15  * \ingroup mrpt_system_grp
16  * @{ */
17 // clang-format on
18 
19 /** The type for cross-platform process (application) priorities.
20  * \sa changeCurrentProcessPriority
21  */
23 {
24  ppIdle = 0,
28 };
29 
30 /** The type for cross-platform thread priorities.
31  * \sa changeThreadPriority
32  */
34 {
35  tpLowests = -15, //!< Win32: THREAD_PRIORITY_IDLE
36  tpLower = -2, //!< Win32: THREAD_PRIORITY_LOWEST
37  tpLow = -1, //!< Win32: THREAD_PRIORITY_BELOW_NORMAL
38  tpNormal = 0, //!< Win32: THREAD_PRIORITY_NORMAL
39  tpHigh = 1, //!< Win32: THREAD_PRIORITY_ABOVE_NORMAL
40  tpHigher = 2, //!< Win32: THREAD_PRIORITY_HIGHEST
41  tpHighest = 15 //!< Win32: THREAD_PRIORITY_TIME_CRITICAL
42 };
43 
44 /** Change the priority of the current thread - for Windows, see also
45  * changeCurrentProcessPriority()
46  * - Windows: This is equivalent to
47  * [SetThreadPriority()](https://msdn.microsoft.com/en-us/library/windows/desktop/ms686277(v=vs.85).aspx)
48  * (read the docs there)
49  * - Linux (pthreads): May require `root` permissions! This sets the Round Robin
50  * scheduler with the given priority level. Read
51  * [sched_setscheduler](http://linux.die.net/man/2/sched_setscheduler). \sa
52  * createThread, changeCurrentProcessPriority, changeCurrentThreadPriority
53  */
55 
56 /** Change the priority of the given process (it applies to all the threads,
57  plus independent modifiers for each thread).
58  * - Windows: See
59  [SetPriorityClass](https://msdn.microsoft.com/es-es/library/windows/desktop/ms686219(v=vs.85).aspx)
60  * - Linux (pthreads): Requires `root` permissions to increase process
61  priority! Internally it calls [nice()](http://linux.die.net/man/3/nice), so it
62  has no effect if
63  () was called and a SCHED_RR is already active.
64  * \sa createThread, changeThreadPriority
65  */
67 
68 /** @} */
69 
70 } // namespace mrpt::system
void changeCurrentThreadPriority(TThreadPriority priority)
Change the priority of the current thread - for Windows, see also changeCurrentProcessPriority() ...
Definition: scheduler.cpp:43
Win32: THREAD_PRIORITY_ABOVE_NORMAL.
Definition: scheduler.h:39
void changeCurrentProcessPriority(TProcessPriority priority)
Change the priority of the given process (it applies to all the threads, plus independent modifiers f...
Definition: scheduler.cpp:109
TProcessPriority
The type for cross-platform process (application) priorities.
Definition: scheduler.h:22
Win32: THREAD_PRIORITY_LOWEST.
Definition: scheduler.h:36
Win32: THREAD_PRIORITY_IDLE.
Definition: scheduler.h:35
Win32: THREAD_PRIORITY_NORMAL.
Definition: scheduler.h:38
TThreadPriority
The type for cross-platform thread priorities.
Definition: scheduler.h:33
Win32: THREAD_PRIORITY_TIME_CRITICAL.
Definition: scheduler.h:41
Win32: THREAD_PRIORITY_HIGHEST.
Definition: scheduler.h:40
Win32: THREAD_PRIORITY_BELOW_NORMAL.
Definition: scheduler.h:37



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020