logo

Quotes About Concurrency

If you haven't considered concurrent access in your class design, some of these approaches can require significant design modifications, so fixing the problem might not be as trivial as this advice makes it sound. It is far easier to design a class to be thread-safe than to retrofit it for thread safety later. In
~ Brian Goetz
A class is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination on the part of the calling code.
~ Brian Goetz
Stateless objects are always thread-safe.
~ Brian Goetz
A race condition occurs when the correctness of a computation depends on the relative timing or interleaving of multiple threads by the runtime; in other words, when getting the right answer relies on lucky timing.
~ Brian Goetz
A synchronized block has two parts: a reference to an object that will serve as the lock, and a block of code to be guarded by that lock.
~ Brian Goetz
Static synchronized methods use the Class object for the lock.)
~ Brian Goetz
Immutable objects are always thread-safe.
~ Brian Goetz
Every LWP has a kernel thread, but every kernel thread need not have an LWP:
~ Gian-Paolo D. Musumeci