MRPT  2.0.1
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 /** \addtogroup mrpt_scheduler Scheduler helpers
14  * (in #include <mrpt/system/scheduler.h>)
15  * \ingroup mrpt_base_grp
16  * @{ */
17 
18 /** The type for cross-platform process (application) priorities.
19  * \sa changeCurrentProcessPriority
20  */
22 {
23  ppIdle = 0,
27 };
28 
29 /** The type for cross-platform thread priorities.
30  * \sa changeThreadPriority
31  */
33 {
34  tpLowests = -15, //!< Win32: THREAD_PRIORITY_IDLE
35  tpLower = -2, //!< Win32: THREAD_PRIORITY_LOWEST
36  tpLow = -1, //!< Win32: THREAD_PRIORITY_BELOW_NORMAL
37  tpNormal = 0, //!< Win32: THREAD_PRIORITY_NORMAL
38  tpHigh = 1, //!< Win32: THREAD_PRIORITY_ABOVE_NORMAL
39  tpHigher = 2, //!< Win32: THREAD_PRIORITY_HIGHEST
40  tpHighest = 15 //!< Win32: THREAD_PRIORITY_TIME_CRITICAL
41 };
42 
43 /** Change the priority of the current thread - for Windows, see also
44  * changeCurrentProcessPriority()
45  * - Windows: This is equivalent to
46  * [SetThreadPriority()](https://msdn.microsoft.com/en-us/library/windows/desktop/ms686277(v=vs.85).aspx)
47  * (read the docs there)
48  * - Linux (pthreads): May require `root` permissions! This sets the Round Robin
49  * scheduler with the given priority level. Read
50  * [sched_setscheduler](http://linux.die.net/man/2/sched_setscheduler). \sa
51  * createThread, changeCurrentProcessPriority, changeCurrentThreadPriority
52  */
54 
55 /** Change the priority of the given process (it applies to all the threads,
56  plus independent modifiers for each thread).
57  * - Windows: See
58  [SetPriorityClass](https://msdn.microsoft.com/es-es/library/windows/desktop/ms686219(v=vs.85).aspx)
59  * - Linux (pthreads): Requires `root` permissions to increase process
60  priority! Internally it calls [nice()](http://linux.die.net/man/3/nice), so it
61  has no effect if
62  () was called and a SCHED_RR is already active.
63  * \sa createThread, changeThreadPriority
64  */
66 
67 /** @} */
68 
69 } // 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:38
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:21
Win32: THREAD_PRIORITY_LOWEST.
Definition: scheduler.h:35
Win32: THREAD_PRIORITY_IDLE.
Definition: scheduler.h:34
Win32: THREAD_PRIORITY_NORMAL.
Definition: scheduler.h:37
TThreadPriority
The type for cross-platform thread priorities.
Definition: scheduler.h:32
Win32: THREAD_PRIORITY_TIME_CRITICAL.
Definition: scheduler.h:40
Win32: THREAD_PRIORITY_HIGHEST.
Definition: scheduler.h:39
Win32: THREAD_PRIORITY_BELOW_NORMAL.
Definition: scheduler.h:36



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020