“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 (101929)
- life (80575)
- inspirational (76813)
- humor (44733)
- philosophy (31440)
- inspirational-quotes (28706)
- god (27021)
- truth (24936)
- wisdom (24936)
- romance (24629)
- poetry (23640)
- life-lessons (22727)
- quotes (21258)
- death (20752)
- happiness (18995)
- hope (18770)
- faith (18581)
- inspiration (17999)
- motivational (15973)
- spirituality (15969)
- relationships (15847)
- religion (15506)
- life-quotes (15265)
- writing (15056)
- love-quotes (14852)
- success (14192)
- motivation (14003)
- time (12946)
- science (12242)
- motivational-quotes (12182)



