Why does System.Threading.Timer callback successfully update UI?
Posted
by
Geo P
on Stack Overflow
See other posts from Stack Overflow
or by Geo P
Published on 2012-06-04T16:31:25Z
Indexed on
2012/06/04
16:43 UTC
Read the original article
Hit count: 208
c#
|multithreading
I have several System.Threading.Timers on my form application with callbacks that update the UI...successfully - i.e. without throwing errors.
I had built these earlier, before I knew that UI should not be updated on any thread other than the UI thread.
Now I am confused as to why it does not throw cross-thread exceptions when I am updating UI on these separate threading.timer threads?
I will be changing these callbacks so that the UI updates are invoked on UI thread, but I am curious as to why this works.
Edit: My application is a WinForms Application.
© Stack Overflow or respective owner