Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: Indy10 - Get thread object

www.cryer.info
Managed Newsgroup Archive

Re: Indy10 - Get thread object

Subject:Re: Indy10 - Get thread object
Posted by:"Martin James" (nospam@dial.pipex.com)
Date:Sat, 16 Dec 2006 07:52:07

Remy Lebeau (TeamB) wrote:
> "Martin James" <nospam@dsl.pipex.com> wrote in message
> news:4582bb0a$1@newsgroups.borland.com...
>
>> 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.
>
> That would be very inefficient, as OnExecute is triggered in a loop for each
> connection.

A 'priorityAlreadyChanged' flag in the socket context - no problem.
Perhaps I should have explained that calling an expensive API on each
loop should be avoided!

   Also, like you said, a connection could jump from one thread to
> another.  And worse, if you use fibers, then you can have multiple
> connections running on a single thread.

..and you have no idea which thread it's going to be.

Rgds,
Martin

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive