Topic Path: Symbol Reference > Functions > SetThreadPriority Function
ContentsIndexHome
PreviousUpNext
SetThreadPriority Function

Adjusts the priority of a thread relative to other processes.

File
procedure SetThreadPriority(
    AThread: TIdNativeThread; 
    const APriority: TIdThreadPriority; 
    const APolicy: Integer = -MaxInt
);
Parameters 
Description 
AThread 
Thread for the priority assignment.
 
APriority 
Priority value to assign for the specified thread.
 
APolicy 
Default value is -1*MaxInt. 

SetThreadPriority is a Procedure used to adjust the priority of THE specified thread relative to other processes executing on the local computer system. SetThreadPriority calls the platform- or operating system-specific APIs required to adjust the thread priority.

Boosting the thread priority of a CPU intensive operation may adversely affect other threads in the application. Only apply priority boosts to threads that spend most of their time waiting for external events. 

SetThreadPriority is used internally in Indy when a new thread scheduler is created.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.