Answer the question
In order to leave comments, you need to log in
Is it enough to set the volatile property to a variable in order to work with it from several threads without any problems?
Actually the question is this: I have a variable, a string with data, with which one thread constantly works, but in read-only mode, and another thread periodically writes data to this variable. Will it be enough to add a volatile property to the variable so that no problems arise?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question