GEOS SDK TechDocs
|
|
4.1 How GEOS Threads Are Created
|
4.3 Handling Errors in a Thread
ThreadGetInfo(), ThreadModify(), ThreadGetInfoType
You can ascertain and modify the priority of any thread in the system, given the thread's handle. The handle is provided by the routines that create threads, and it can be provided by one thread to another in a message. The following system routines relate to the priority of a thread:
ThreadGetInfo()
returns information about a thread. When calling
ThreadGetInfo()
,
pass the handle of the thread in question and a value of the type
ThreadGetInfoType
(see below). If zero is passed as the thread handle,
ThreadGetInfo()
returns information on whatever thread executed the call.
ThreadGetInfoType
is an enumerated type with three possible values:
T
hreadModify()
changes the priority of a thread. The arguments to pass include the handle of the thread to modify (zero for the thread executing the call), a new base priority for the thread, and two flags: One that indicates whether to change the thread's base priority and one that indicates whether to reset the thread's recent CPU usage to zero. If the flag to change the thread's base priority is not set, the new base priority argument is ignored. In general, you should only lower a thread's priority (i.e., raise its base priority number). Applications that raise their own priority damage the performance of the system as a whole. Keep in mind that GEOS already favors the thread with which the user is interacting.
There are several pre-defined priority levels you can use to set a thread's priority. You may wish to use these when debugging to raise the priority of a potentially buggy thread for efficient debugging. These are listed below, each a different constant.
GEOS SDK TechDocs
|
|
4.1 How GEOS Threads Are Created
|
4.3 Handling Errors in a Thread