What everyone is saying is as I hoped, that if I prefer the simple dumb and safe default situation of one timer needs to finish operation before any other fires then I don't need to take special precautions.
On the other hand if I put an Application.processmessages in the timer loop, then it may well fire the other one in the middle, and I should be careful about the timers interacting. John -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leigh Wanstead Sent: Tuesday, 7 March 2006 10:40 a.m. To: NZ Borland Developers Group - Delphi List Subject: RE: [DUG]Timers Hi Matt and Stefan, Both of you are right. I just make a project to test that. Just rename the attachment to timer.zip and unzip to a folder. It is a Delphi 7 project. Now I realized that the importance of processmessages. ;-) Regards Leigh -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Matthew Comb Sent: Tuesday, 7 March 2006 10:20 a.m. To: [EMAIL PROTECTED]; NZ Borland Developers Group - Delphi List Cc: NZ Borland Developers Group - Delphi List; [email protected] Subject: RE: [DUG]Timers Delphi Timers are not threaded. if you have two timers and put a sleep of 30 seconds in one, the time event for the other will not fire until the first is completed. They are run in the main application thread and are sequential. One way you can counter this is if you have a loop in the first timer event, you can call application.processmessages which would allow the message to get through to the second timer. Threaded timers are a completely different story. Matt. > 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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] 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 > [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi > > > _______________________________________________ > Delphi mailing list > [email protected] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi __________ NOD32 1.1432 (20060306) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi
