Jump to content

Which Thread do Timers run on?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
Do timers run on the same thread that created them? Or do they run on another thread in the background?

#2
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts
No, I do not think so. If they did it would hault your entire program, which they do not.

for (int i;;) {

   cout << "Smith";

}


#3
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
They fire on another thread, though you can pass in an ISynchronizeInvoke (like a Control) that can marshal the event to the UI (or another) thread if you want.

#4
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
Makes sense now that I think about it. Thanks guys.