Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Threads and CPU Usage

www.cryer.info
Managed Newsgroup Archive

Threads and CPU Usage

Subject:Threads and CPU Usage
Posted by:"Graham Powell" (grah..@deephaven.co.uk)
Date:Wed, 23 Mar 2005 18:31:01

I expect this is obvious when some explains it to me.
I create a low priority thread:

MyThread := TMyThread.Create

with MyThread do
begin
  OnTerminate := MyThreadDone;
  Priority := tpLowest;
  FreeOnTerminate := true;
  Resume;
end;

The Execute part of the thread just sits around in a loop monitoring the
Terminate status. It will exit the loop the Terminate is true.

While the thread is running the CPU usage is 99%. Is that what you get or is
there a better way. I just need a low level thread running a TServerSocket
listening for a connection.

Thanks for any help

Replies:

www.cryer.info
Managed Newsgroup Archive