<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Phil</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I came across the same problem. I got around it by 
putting&nbsp;sleep(10000) in the execute method, when the thread wasn't actually 
processing any data.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Todd.</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=phil@tumonz.co.nz href="mailto:phil@tumonz.co.nz">Phil Middlemiss</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz 
  href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi 
  List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, October 15, 2004 11:16 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] Thread processes</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>I have a thread that sits in the background 
  waiting for input from&nbsp;a COM port. the execute method simple has these 
  two lines:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp; while not Terminated 
  do<BR>&nbsp;&nbsp;&nbsp; Application.ProcessMessages;<BR></FONT></DIV>
  <DIV><FONT face=Arial size=2>The problem with this is that the processor usage 
  is very high, even if the thread is doing nothing but sitting there calling 
  processmessages.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>The main application thread doesn't have this 
  problem, yet it also has a message handling routine. </FONT><FONT face=Arial 
  size=2>Is there a way to avoid this problem in threads?</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
  <DIV><FONT face=Arial size=2>Phil.</DIV></FONT>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Delphi mailing 
  list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BODY></HTML>