LabWindows/CVI

Content Type
Programming Language
Current manual

CmtGetCurrentThreadPriority

CmtGetCurrentThreadPriority

int CmtGetCurrentThreadPriority (int *priority);

Purpose

Gets the priority of the current thread.

(Linux) This function is not supported.

Parameters

Output
Name Type Description
priority int The priority of the current thread.

On Windows, this priority value in combination with the priority class of the processpriority class of the process determines the base priority level of the thread. The operating system uses this base priority level to schedule threads on the CPU. You can set the priority class of a process with the Windows SDK function SetPriorityClass. The thread priority value can be one of the following:

Name Value
THREAD_PRIORITY_TIME_CRITICAL 15
THREAD_PRIORITY_HIGHEST 2
THREAD_PRIORITY_ABOVE_NORMAL 1
THREAD_PRIORITY_NORMAL 0
THREAD_PRIORITY_BELOW_NORMAL -1
THREAD_PRIORITY_LOWEST -2
THREAD_PRIORITY_IDLE -15

(RT) On real-time systems the thread priority can be any value from -15 to 15. The default priority of a thread in the system is 0. The operating system scheduler runs at priority level 9. Any threads running at a priority level equal to or higher than 9 are not subject to timeslicing by the scheduler and will run until they yield the CPU or are preempted by a higher priority thread.

Return Value

Name Type Description
cmtStatus int The CmtStatus code that the function call returns. This function returns 0 to indicate success and negative values to indicate failure. Pass the CmtStatus code to CmtGetErrorMessage to get a description of the error code.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 9.0 and later

Was this information helpful?