[DUG]Timers

Stefan Mueller muellers at orcl-toolbox.com
Tue Mar 7 10:23:17 NZDT 2006


Au contraire...

OnTimers events get triggered through the normal message loop. There is no
multi-threated code in timers. And yes, the long running will delay
execution of the other timer ... and even worse, multiple ontime messages
will get ignored and only a single ontime gets triggered.

Lets say your first timer starts every 1second .. the other timer too, but
needs 4 second to finish it's work (make a sleep(4000);) .. then both timers
will only get executed once every 4 second!

Kind Regards,
Stefan Mueller 

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Leigh Wanstead
Sent: Tuesday, 7 March 2006 10:11 a.m.
To: johnkbird at paradise.net.nz; NZ Borland Developers Group - Delphi List
Subject: RE: [DUG]Timers

Hi John,

It won't hold up others.

You must be very careful  of in modifying variables shared between the two
timers. You can use some sorts of locking code to do that.

Regards
Leigh
New Zealand's largest stabilizer manufacturer for camera
http://www.SmoothArm.com

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz
[mailto:delphi-bounces at ns3.123.co.nz]On Behalf Of John Bird
Sent: Tuesday, 7 March 2006 9:59 a.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG]Timers


If I have two timers active in a program, and occasionally one of them takes
a while to execute its code, does it hold up the other timer from firing
until it is done?

Or phrased another way can I think of two timers as if running in separate
threads, or in the same thread, so that one finishes before the other can
get a chance to run.

The reason I am wondering is if there are any issues to be careful of in
modifying variables shared between the two timers.

John

_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi





More information about the Delphi mailing list