I have a class that uses BackgroundWorker.
At the top of the class I have some variables that are accessible to all the class' methods.
I use them all both in methods that run on the main thread and in methods that run in the BackgroundWorker thread.
Everything seems to work OK but I wonder now if its OK for a variable to be accessed by two threads.
Is it.?
If not, is it OK to have them at class level but only used by one thread?
At the top of the class I have some variables that are accessible to all the class' methods.
I use them all both in methods that run on the main thread and in methods that run in the BackgroundWorker thread.
Everything seems to work OK but I wonder now if its OK for a variable to be accessed by two threads.
Is it.?
If not, is it OK to have them at class level but only used by one thread?