You're right. This is what I ended up doing. PauseEvent := TEvent.Create(nil,FALSE,FALSE,'PauseEvent');
while not Terminated do PauseEvent.WaitFor(1000); On the advice of another Delphi programmer I pulled the thread from the app and just created a form with visible set to false. It came in handy for temporarily showing some of the thread variables while I was searching for a divide by zero error. The rest of the code was identical but I didn't have to do any .create operations. The down side is I can't raise the priority. John Automation Artisans Inc. http://www.autoartisans.com/ELS/ Ph. 1 250 544 4950 > -----Original Message----- > From: delphi-boun...@elists.org > [mailto:delphi-boun...@elists.org] On Behalf Of Ross Levis > Sent: Tuesday, May 05, 2009 8:57 PM > To: 'Borland's Delphi Discussion List' > Subject: RE: Idle thread > > > For a start, I think you will want to call the sleep function > in the Execute > loop otherwise the CPU will go to 100%, and having a tpHigher > priority, this > will likely semi-hang your main program thread. > > Ross. > > -----Original Message----- > From: delphi-boun...@elists.org > [mailto:delphi-boun...@elists.org] On Behalf > Of John Dammeyer > Sent: Wednesday, 6 May 2009 7:56 a.m. > To: 'Borland's Delphi Discussion List' > Subject: Idle thread > > Hi, > > I've created a unit that has a thread that has a TTimer > object that runs > periodically to access an A/D converter. > > AtoDThread := TAcquisitionThread.Create(FALSE); > AtoDThread.Priority := tpHigher; > AtoDThread.Resume; // now run the thread > > Inside the AtoDThread the Execute > > DLPortIO := TDLPortIO.Create(nil); > DLPortIO.DriverPath := 'c:\DMT\Plotter'; // This is where we've > installed it. > > AtoDState := RESET_HARDWARE_STATE; > while not Terminated do > ; // Do nothing but ideally suspend somehow while leaving > the timer running. > > What I'd like to do is just have the Execute thread do > nothing else other > than let the timer fire which then gathers the data and fills > appropriate > variables etc. > > If I suspend the thread I believe it will also suspend the > timer won't it? > What's a better way to block the execute part of the thread > while leaving > the timer active? > > Thanks > John > > _______________________________________________ > Delphi mailing list -> Delphi@elists.org > http://lists.elists.org/cgi-bin/mailman/listinfo/delphi > > _______________________________________________ Delphi mailing list -> Delphi@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi