ThreadPriority

(Engine-Level Function)

Description Allows advanced users to set a specified thread to one of six priorities, ranging from idle to time critical.
Warning: This statement is recommended for advanced users only.
Returns: Nothing
Usage: Script Only.
Function Groups: Basic Module
Related to:
Format: ThreadPriority(ObjectReference, Priority)
Parameters:  
ObjectReference
Required. Indicates the thread to be modified.
Priority
Required. A value from -3 to 3 that indicates the priority of the thread. This may be one of:

Priority

Description

-3

THREAD_PRIORITY_IDLE

-2

THREAD_PRIORITY_LOWEST

-1

THREAD_PRIORITY_BELOW_NORMAL

0

THREAD_PRIORITY_NORMAL (Default)

1

THREAD_PRIORITY_ABOVE_NORMAL

2

THREAD_PRIORITY_HIGHEST

3

THREAD_PRIORITY_TIME_CRITICAL

Comments: All threads default to THREAD_PRIORITY_NORMAL. The operating system will place priority on threads operating at higher priorities over threads operating at lower priorities. The responsiveness of higher priority threads is therefore improved (at the expense of lower priority thread responsiveness).
Threads that share information amongst themselves may see performance drop if they don’t all operate at the same priority. Similarly high priority threads that perform extended operations may prevent lower priority threads from operating at all. Use of high priority threads is typically appropriate to short operations that need to be performed without delay or to processes that are intolerant of interruption.