Understanding Executor Framework vs Direct Thread Creation
The Executor framework decouples thread creation from task execution. Consider the following two implementations:
1: TaskExecutionWebServer.java
package chapter06;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class TaskExec ...
Posted on Thu, 07 May 2026 17:57:28 +0000 by Ree
Understanding MySQL MVCC: Implementation and Performance Tuning
Understanding MySQL MVCC: Implementation and Performance Tuning
Core Concepts
Version Chain Mechanism
MVCC enables InnoDB to maintain multiple versions of the same row data. Each modification creates a new version while preserving historical states through a linked structure.
Undo Log Chain: When a row gets updated, InnoDB stores the previous ...
Posted on Thu, 07 May 2026 15:29:12 +0000 by Stephen
Immutable Objects in Java Concurrent Programming
Immutable Objects
Let's examine the date conversion problem first.
@Slf4j(topic = "c.DateParseDemo")
public class DateParseDemo {
public static void main(String[] args) {
runAnalysis();
}
private static void runAnalysis() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
...
Posted on Thu, 07 May 2026 13:45:29 +0000 by rptasiuk
Implementing Thread-Safe Counters in Java
In concurrent programmnig, a shared counter must be thread-safe to prevent data races and inconsistencies when accessed by multiple threads simultaneously. Two primary approaches to achieve this are using atomic variables and explicit synchronization via locks.
Using AtomicInteger
AtomicInteger provides atomic operations without requiring expli ...
Posted on Thu, 07 May 2026 13:32:40 +0000 by andrewgauger
MySQL Locking Mechanisms and Concurrency Control Strategies
Locks coordinate concurrent thread access to shared resources. In relational databases, they prevent data corruption during simultaneous reads and writes. MySQL delegates lock implementation to storage engines, resulting in distinct behaviors. MyISAM and MEMORY rely exclusively on table-level locking. InnoDB supports both table and row-level lo ...
Posted on Thu, 07 May 2026 08:39:32 +0000 by Zoxive