“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 (100675)
- life (78882)
- inspirational (75351)
- humor (44112)
- philosophy (30694)
- inspirational-quotes (28600)
- god (26782)
- truth (24564)
- wisdom (24365)
- romance (24197)
- poetry (23079)
- life-lessons (22231)
- quotes (20509)
- death (20449)
- happiness (18879)
- hope (18393)
- faith (18265)
- inspiration (17186)
- spirituality (15577)
- relationships (15364)
- religion (15307)
- motivational (15224)
- life-quotes (15146)
- love-quotes (15020)
- writing (14881)
- success (14127)
- motivation (13062)
- travel (12918)
- time (12783)
- science (12002)