“Compound actions on shared state, such as incrementing a hit counter (read-modify-write) or lazy initialization (check-then-act), must be made atomic to avoid race conditions. Holding a lock for the entire duration of a compound action can make that compound action atomic. However, just wrapping the compound action with a synchronized block is not sufficient; if synchronization is used to coordinate access to a variable, it is needed everywhere that variable is accessed. Further, when using locks to coordinate access to a variable, the same lock must be used wherever that variable is accessed.”
―
Java Concurrency in Practice
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
2 likes
All Members Who Liked This Quote
This Quote Is From
Browse By Tag
- love (101244)
- life (79195)
- inspirational (75722)
- humor (44297)
- philosophy (30923)
- inspirational-quotes (28828)
- god (26841)
- truth (24713)
- wisdom (24579)
- romance (24326)
- poetry (23220)
- life-lessons (22569)
- quotes (20935)
- death (20519)
- travel (20048)
- happiness (18931)
- hope (18512)
- faith (18363)
- inspiration (17282)
- spirituality (15680)
- relationships (15489)
- religion (15363)
- life-quotes (15272)
- motivational (15266)
- love-quotes (15114)
- writing (14928)
- success (14168)
- motivation (13121)
- time (12837)
- motivational-quotes (12101)



