Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@magicMirror
In a multi threaded app, how do you control concurrent access to members if you access them directly? -
"choose one" means choosing the correct one for your scenario. and the bigger question is why two threads will need write access to the same object fields. refactor your code to eliminate that.
-
@magicMirror
Two threads may not need write access to a field. One may write, while another reads. How do you ensure the correct value is read by the second thread? Mutable, non-private members shouldn't be used in a multi threaded app (in my opinion).
Related Rants
Not using getters and setters and accesing variables publicly.
undefined
wk47