Alex Rivera | Logout

Does the System.Windows.Forms.Timer run on a different thread than the UI?

Asked 2011-04-17T15:42:47.147
26

I have a main thread that creates a form object which creates and sets a timer to run a function named updateStatus() every minute. But updateStatus() is also called by the main thread at several places.

However, I am not clear about whether or not it will cause any synchronization problems. Does the System.Windows.Forms.Timer in C# run on a different thread other than the main thread?

Edit
Report

1 Answer

9

No, the timer's Tick event is raised from the UI thread by the message loop when it receives a WM_TIMER message. You're always good with that, it can only run when your UI thread is idle.

answered 2011-04-17T15:47:53.110

Your Answer