Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Timers run on the creating thread?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Water Cooler v2 - 11 Jul 2006 10:13 GMT
Do timers run on the same thread that creates them or (internally) a
new thread is spawned per timer?
Damien - 11 Jul 2006 11:17 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.