Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: Indy10 - Get thread object
| Subject: | Re: Indy10 - Get thread object |
| Posted by: | "Martin James" (nospam@dsl.pipex.com) |
| Date: | Fri, 15 Dec 2006 15:12:19 |
"Franz Steiner" <nomail@nomail.com> wrote in message
news:4582afaf$1@newsgroups.borland.com...
>
> Hi,
>
> How can I access to the TThread object which executes the OnExecute event
in a TIdTPCServer (Indy 10) ? I need to change the priority of the threads
which execute the commands sent by the clients and I don't know what I've to
do in order to get this object...
Well, since the OnExecute event is run by the thread, you can call the
GetCurrentThread API in the event to get a handle to the thread.and change
its priority.
Note that later versions of Indy may well have a pool of threads and
OnExecute may be called from any one of a small pool of threads, ie. if you
change the priority of one, the next OnExecute call may be made from one of
the others :(
In such cases, you can leave the priority of the Indy pool threads as it is
and queue off work to another thread/pool running at a different priority.
Rgds,
Martin