In normal circunstances it should’t be possible to access to properties values assigned on main thread on TimerCallback function, right?
I have a class that uses a timer and this class has a method for TimerCallback, well, I access properties on this method as if there were no multithreading (I see the values assigned on main thread)
If necessary I’ll paste some code, but I wanted to know first if I have a major confusion in relation to Timers.
Thanks
Wrong! this is only when you are using UI that rely on the main thread, example when using winforms UI and WPF and even some COM compoents you only should access to its members from the thread that they created on, no matter if it where the main thread or not.
However for a custom class you build, it doesn’t matter which thread access the member, that is it, any thread can access the class and its members no matter it it where on the thread that creates that class or not.