xtd 0.2.0
Loading...
Searching...
No Matches

◆ base_priority()

int32 xtd::diagnostics::process::base_priority ( ) const

Gets the base priority xof the associated process.

Returns
The base priority, which is computed from the xtd::diagnostics::process::priority_class of the associated process.
Exceptions
xtd::invalid_operation_exceptionThere is no process associated with this xtd::diagnostics::process object.
Remarks
The value returned by this property represents the most recently refreshed base priority of the process. To get the most up to date base priority, you need to call xtd::diagnostics::process::refresh() method first.
The xtd::diagnostics::process::base_priority of the process is the starting priority for threads created within the associated process. You can view information about the base priority through the System Monitor's Priority Base counter.
Based on the time elapsed or other boosts, the operating system can change the base priority when a process should be placed ahead of others.
The xtd::diagnostics::process::base_priority property lets you view the starting priority assigned to a process. However, because it is read-only, you cannot use the xtd::diagnostics::process::base_priority to set the priority of the process. To change the priority, use the xtd::diagnostics::process::priority_class property. The xtd::diagnostics::process::base_priority is viewable using the System Monitor, while the xtd::diagnostics::process::priority_class is not. Both the xtd::diagnostics::process::base_priority and the xtd::diagnostics::process::priority_class can be viewed programmatically. The following table shows the relationship between xtd::diagnostics::process::base_priority values and xtd::diagnostics::process::priority_class values.
Windows base_priority macOS base_priority linux base_priority priority_class
4 PRIO_MIN (-20) PRIO_MIN (-20)  xtd::diagnostics::process_priority_class::idle
6 PRIO_MIN + (PRIO_MAX - PRIO_MIN) / 4 (-10) PRIO_MIN + (PRIO_MAX - PRIO_MIN) / 4 (-10)  xtd::diagnostics::process_priority_class::below_normal
8 PRIO_MIN + (PRIO_MAX - PRIO_MIN)/2 (0) PRIO_MIN + (PRIO_MAX - PRIO_MIN)/2 (0)  xtd::diagnostics::process_priority_class::normal
10 PRIO_MAX - (PRIO_MAX - PRIO_MIN) / 4 (10) PRIO_MAX - (PRIO_MAX - PRIO_MIN) / 4 (10)  xtd::diagnostics::process_priority_class::above_normal
13 PRIO_MAX - (PRIO_MAX - PRIO_MIN) / 8 (15) PRIO_MAX - (PRIO_MAX - PRIO_MIN) / 8 (15)  xtd::diagnostics::process_priority_class::high
24 PRIO_MAX (20) PRIO_MAX (20)  xtd::diagnostics::process_priority_class::real_time