Thread.Priority

From Xojo Documentation

Property (As Integer )
aThread.Priority = newIntegerValue
or
IntegerValue = aThread.Priority

New in 2005r1

Supported for all project types and targets.

Gets and sets the relative priority of the thread.

Notes

The Priority can be changed while a Thread is running.

The application's main thread has a priority of 5 and this is also the default value of any programmatically created threads. If you don’t modify this value, your application will behave normally, in the sense that all the threads will share the CPU's resources equally.

Increasing the value of Priority above 5 gives that thread more processing cycles than other threads. Doubling the value of Priority will double the number of processing cycles the thread gets. A thread with a Priority of 1 will get one-fifth the processing cycles as the main thread. The range is 1 to 2^31-1, but very high values of Priority will make it difficult for other threads to run at all. The value of Priority changes the way in which threads get processing cycles only if their values are not all equal. You can use the following class constants to assign to Priority or to compare its value:

Value Description
1 LowestPriority
5 NormalPriority
10 HighPriority

You do not need to use these constants; you can use any legal integer value instead.

Sample Code

This example lowers the priority of the thread prior to calling its Run method.

Thread1.Priority = Thread.LowestPriority
Thread1.Run