> Do timers run on the same thread that creates them or (internally) a
> new thread is spawned per timer?
It depends on which Timer you are referring to. If it is the Timer
within System.Windows.Forms, then it'll run on the UI thread. If it's
the Timer within System.Threading, then I believe it runs in another
thread. Whether this thread is newly created, or from the thread pool,
or from some internal pool, I'm not sure. But I'm fairly certain it
won't be the original thread. After all, the original thread has
carried on, and could be in any state when the timer elapses (e.g. it
might be in the middle of a multi-second database call)
Damien
Michael D. Ober - 12 Jul 2006 03:17 GMT
The System.Threading timer events are executed from a Thread Pool thread.
Mike Ober.
> > Do timers run on the same thread that creates them or (internally) a
> > new thread is spawned per timer?
[quoted text clipped - 9 lines]
>
> Damien
Dennis - 14 Jul 2006 00:39 GMT
Which thread will receive the event then for the System.Threading timer.

Signature
Dennis in Houston
> The System.Threading timer events are executed from a Thread Pool thread.
>
[quoted text clipped - 13 lines]
> >
> > Damien
William Stacey [MVP] - 14 Jul 2006 01:52 GMT
The callback is run on a ThreadPool thread. What event are you referring
to? tia

Signature
William Stacey [MVP]
| Which thread will receive the event then for the System.Threading timer.
|
[quoted text clipped - 15 lines]
| > >
| > > Damien