“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 (100747)
- life (78951)
- inspirational (75397)
- humor (44130)
- philosophy (30732)
- inspirational-quotes (28635)
- god (26794)
- truth (24592)
- wisdom (24381)
- romance (24223)
- poetry (23086)
- life-lessons (22300)
- quotes (20626)
- death (20468)
- happiness (18902)
- hope (18414)
- faith (18276)
- inspiration (17208)
- spirituality (15600)
- relationships (15376)
- religion (15316)
- motivational (15228)
- life-quotes (15167)
- love-quotes (15030)
- writing (14885)
- success (14117)
- travel (14001)
- motivation (13071)
- time (12792)
- science (12022)