Re: when is threading better than a timer?

From: Bob (noone_at_nowhere.com)
Date: 09/29/04


Date: Wed, 29 Sep 2004 10:36:24 -0400

It's milliseconds. Looks like I was using the right Timer class, too
(System.Windows.Forms.Timer), since I wanted it to mesh with and respect the
UI. Very good links, thank you.

Bob

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message
news:OF807%23ipEHA.3172@TK2MSFTNGP10.phx.gbl...
> Bob,
> If you have a long running process (half a minute or longer) I would
> recommend a separate thread. By long running, I mean if it takes long
enough
> that the user will start to think your app stopped responding (hung).
>
> If the database check takes fractions of a second I would leave it as a
> Windows Timer.
>
> Remember there are three distinct timer objects in .NET. One of the other
> two may be more appropriate, the following articles in MSDN Magazine
explain
> the difference between the three timer objects in .NET & when to use each.
>
> http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/default.aspx
>
> http://msdn.microsoft.com/msdnmag/issues/04/03/default.aspx
>
> The above articles also discusses if & how each timer interacts with
> threading.
>
> Hope this helps
> Jay
>
>
> Hope this helps
> Jay
>
> "Bob" <noone@nowhere.com> wrote in message
> news:ei6CKhipEHA.3520@TK2MSFTNGP11.phx.gbl...
> > Okay, I've done this for years but now I'm going to question it just
> > because
> > this idea has been at the back of my head since I started using
DotNet...
> >
> > My WinForms app queries a database every 60 seconds. I set up a
singleton
> > class that's instantiated when the app starts, and that starts a timer.
My
> > question is, would it be better to run this checking process on a
separate
> > thread and have it use its own DB connection? If there isn't a clear yes
> > or
> > no, what circumstances affect the answer?
> >
> > TIA,
> > Bob
> >
> >
>
>