“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.”
Quote by Brian Goetz
Work
Java Concurrency in Practice
Browse quotes and source details for this work. more
Author
You May Also Like
Source: Java Concurrency in Practice
Source: Java Concurrency in Practice
Source: Java Concurrency in Practice
“I built your ego, then shattered it when you revealed your true self.”
Source: Slammed
Source: From Mother to Daughter: Advice and Lessons for a Good Life
Source: One Minute to Midnight
Source: Sharon Tate Campaign Plan MMXX