Tagged with "concurrency"
Fun MySQL fact of the day: the phantom record menace
Yesterday, we created an index to prevent a full table scan from locking the entirelist_of_things
table during a single UPDATE
. I mentioned it was an improvement to the problem, but not a complete fix. Today, we'll see why. ... read more
Fun MySQL fact of the day: tenant lock-out
A couple weeks ago, we very briefly touched on the subject about MySQL/InnoDB locking only single records. And since we're on the topic of multi-tenant schemas, I think it's a good time to focus on this subject. For now, we'll focus on using MySQL's default isolation,REPEATABLE READ
. ... read more
Fun MySQL fact of the day: REPEATABLE READ
isn't REPEATABLE WRITE
Since we're on the topic of transaction isolation, you might have previously had a mental model that transaction isolation levels are a layered model, each one stronger than the next. Unfortunately, this isn't quite true; and if that's not annoying enough, you might even be surprised to learn that ... read more
The Cost Of Consistency: When 9ms Is 1s Too Much
The CAP theorem remains one of the most important tools in my software developer's toolbelt. Used correctly, it can help create services and products that can offer an excellent user experience and protect revenue during partial failures. Used incorrectly, it can lead to a poor user experience and loss of ... read morePessimistic Optimism: The Case Of Unexpected Deadlocks
Despite the fact I've been developing software in one way or another for almost 20 years, I'm constantly surprised how things work, and, once the frustration wears off, I'm intrigued when things break. Lucky for me, over the last few weeks, I've been surprised, frustrated, and intrigued by what, on ... read morePerceiving The Effects Of Cache Coherency In Spin Locks
The "test-and-test-and-set" algorithm is a fairly well-understood solution to reducing latency in spin locks. In particular, the algorithm is often employed to reduce the latency exhibited in the similar "test-and-set" algorithm. Understanding how and why a seeming-superfluous read results in lower latency is rather interesting. ... read moreNo ConcurrentHashSet? No Problem
The JDK provides several concurrentSet
classes, each with their own application, but it does not provide a ConcurrentHashSet
. Using the Collections
utility class, however, such a structure may be created. ... read more
The Concurrency Of ConcurrentHashMap
Java'sConcurrentHashMap
is an excellent point of study when learning about Java's Memory Model. It employs numerous techniques to provide lock-free reads while still guaranteeing safe publication of objects. This article represents my attempt to take the magic out of the ConcurrentHashMap
implementation. ... read more
Escape Analysis & Stack Allocated Objects
In 1999, a paper, Escape Analysis For Java was to appear in the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications. This paper outlined an algorithm to detect whether an object,O
, escaped from the currently executed method, M
, or current thread, T
. This paper ... read more