“From the perspective of a class C, an alien method is one whose behavior is not fully specified by C. This includes… — Brian Goetz Concurrency Copy Share Image
“Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate… — Brian Goetz Concurrency Copy Share Image
“Once an object escapes, you have to assume that another class or thread may, maliciously or carelessly, misuse it. This is a… — Brian Goetz Concurrency Copy Share Image
“Just as it is a good practice to make all fields private unless they need greater visibility, it is a good practice… — Brian Goetz Concurrency Copy Share Image
“The possibility of incorrect results in the presence of unlucky timing is so important in concurrent programming that it has a name:… — Brian Goetz Concurrency Copy Share Image
“Accessing shared, mutable data requires using synchronization; one way to avoid this requirement is to not share. If data is only accessed… — Brian Goetz Concurrency Copy Share Image
“Debugging tip: For server applications, be sure to always specify the -server JVM command line switch when invoking the JVM, even for… — Brian Goetz Concurrency Copy Share Image
“Immutable objects are simple. They can only be in one state, which is carefully controlled by the constructor. One of the most… — Brian Goetz Concurrency Copy Share Image
“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.” — Brian Goetz Concurrency Copy Share Image
“It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.” — Brian Goetz Concurrency Copy Share Image
“Sometimes abstraction and encapsulation are at odds with performance — although not nearly as often as many developers believe — but it… — Brian Goetz Concurrency Copy Share Image
“When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations… — Brian Goetz Concurrency Copy Share Image
“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… — Brian Goetz Concurrency Copy Share Image