logo

Quotes About Concurrency

But if you ask me, is STM better than locks and condition variables? Now you're comparing like with like. Yes. I think it completely dominates locks and condition variables. So just forget locks and condition variables. For multiple program counters, multiple threads, diddling on shared memory on a shared-memory multicore: STM. But is that the only way to write concurrent programs? Absolutely not.
~ Peter Seibel
A sequential implementation of a double-ended queue is a first-year undergraduate programming problem. For a concurrent implementation with a lock per node, it's a research paper problem. That is too big a step. It's absurd for something to be so hard. With transactional memory it's an undergraduate problem again.
~ Peter Seibel
The Difference Between DispatcherTimer and ThreadPoolTimer
~ Adam Nathan
Writing concurrent programs in Java keeps getting easier, but writing concurrent programs that are correct and fast is as difficult as it ever was.
~ Joshua Bloch
Given the difficulty of using wait and notify correctly, you should use the higher-level concurrency utilities instead.
~ Joshua Bloch
a way, processes in Elixir are like objects in an object-oriented system (but they have a better sense of humor).
~ Dave Thomas
Objetos são abstrações de procedimento. Threads são abstrações de agendamento.
~ James O. Coplien
All race conditions, deadlock conditions, and concurrent update problems are due to mutable variables.
~ Robert C. Martin
All race conditions, deadlock conditions, and concurrent update problems are due to mutable variables. You cannot have a race condition or a concurrent update problem if no variable is ever updated. You cannot have deadlocks without mutable locks.
~ Robert C. Martin
Run with More Threads Than Processors Things happen when the system switches between tasks. To encourage task swapping, run with more threads than processors or cores. The more frequently your tasks swap, the more likely you'll encounter code that is missing a critical section or causes deadlock.
~ Robert C. Martin
All race conditions, deadlock conditions, and concurrent update problems are due to mutable variables. All the problems we face in applications that require multiple threads, and multiple processors—cannot happen if there are no mutable variables.
~ Robert C. Martin
an important thing to know about JavaScript: there's one queue and one "thread of control," meaning there is only one of me going through the events one at a time.
~ Eric Freeman
Use locking to control access to global variables. Similar to concurrency control in a multiuser database environment, locking requires that before the value of a global variable can be used or updated, the variable must be checked out. After the variable is used, it's checked back in. During the time it's in use (checked out), if some other part of the program tries to check it out, the lock/unlock routine displays an error message or fires an assertion.
~ Steve McConnell
It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.
~ Brian Goetz
Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using synchronization.
~ Brian Goetz
The possibility of incorrect results in the presence of unlucky timing is so important in concurrent programming that it has a name: a race condition. 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
To ensure thread safety, check-then-act operations (like lazy initialization) and read-modify-write operations (like increment) must always be atomic. We refer collectively to check-then-act and read-modify-write sequences as compound actions: sequences of operations that must be executed atomically in order to remain thread-safe.
~ Brian Goetz
The java.util.concurrent.atomic package contains atomic variable classes for effecting atomic state transitions on numbers and object references. By replacing the long counter with an AtomicLong, we ensure that all actions that access the counter state are atomic.
~ Brian Goetz
With the exception of immutable objects, it is not safe to use an object that has been initialized by another thread unless the publication happens-before the consuming thread uses it.
~ Brian Goetz
Every shared, mutable variable should be guarded by exactly one lock. Make it clear to maintainers which lock that is.
~ Brian Goetz
it is a common misconception that synchronized is only about atomicity or demarcating "critical sections". Synchronization also has another significant, and subtle, aspect: memory visibility. We want not only to prevent one thread from modifying the state of an object when another is using it, but also to ensure that when a thread modifies the state of an object, other threads can actually see the changes that were made.
~ Brian Goetz
When used properly, threads can reduce development and maintenance costs and improve the performance of complex applications.
~ Brian Goetz
always use the proper synchronization whenever data is shared across threads. 3.1.1.
~ Brian Goetz
If multiple threads access the same mutable state variable without appropriate synchronization, your program is broken. There are three ways to fix it: Don't share the state variable across threads; Make the state variable immutable; or Use synchronization whenever accessing the state variable.
~ Brian Goetz