samdeepthink
Author

samdeepthink

Knowledge Planet: Old Dock's Tech Chronicles Zhihu: SamDeepThinking A technical manager who still codes heavily on the front line. From junior developer to tech lead, then tech manager, now leading the whole front‑ and back‑end development team—leveling up along the way. I have some insights on programming, career development, and tech management.

184
Articles
0
Likes
588
Views
0
Comments
Recent Articles

Latest from samdeepthink

100 recent articles max
samdeepthink
samdeepthink
Oct 15, 2026 · Fundamentals

Java Condition: Fine-Grained Thread Wakeup vs notifyAll Pitfalls

This article demonstrates the evolution from synchronized/wait/notify to Lock/Condition for producer-consumer patterns, showing how notifyAll causes spurious wakeups with multiple threads and how Condition enables precise signaling via separate condition queues for producers and consumers.

ConditionJavaLock
0 likes · 14 min read
Java Condition: Fine-Grained Thread Wakeup vs notifyAll Pitfalls
samdeepthink
samdeepthink
Oct 14, 2026 · Backend Development

Java Lock vs synchronized: Timeout, Interrupt & Fair Locking Explained

This article compares Java's synchronized keyword with the Lock interface (ReentrantLock), demonstrating how Lock provides finer-grained control through timeout acquisition (tryLock), interruptible locking (lockInterruptibly), fair/non-fair policies, and manual unlock in finally blocks, with code examples for each scenario.

Fair LockJavaLock
0 likes · 9 min read
Java Lock vs synchronized: Timeout, Interrupt & Fair Locking Explained
samdeepthink
samdeepthink
Oct 12, 2026 · Backend Development

Java CyclicBarrier Deep Dive: Batch Synchronization Patterns & Design Improvements

This article explains Java's CyclicBarrier through two practical examples: coordinating concurrent API stress tests and batch-importing one million Excel rows, then reveals a design flaw where the main thread participates in the barrier and shows how to separate concerns using CountDownLatch for cleaner batch processing.

API Stress TestingBatch ProcessingCountDownLatch
0 likes · 10 min read
Java CyclicBarrier Deep Dive: Batch Synchronization Patterns & Design Improvements
samdeepthink
samdeepthink
Oct 10, 2026 · Backend Development

Why Activity Tables Need Status Fields: Beyond Start and End Times

The article explains why marketing activity tables require a status field (draft, approving, release, cancelled) alongside start_time and end_time, because time fields alone cannot represent manual termination, approval workflows, or operational interventions, and demonstrates SQL queries combining both dimensions.

Backend DevelopmentSQL queriesactivity table design
0 likes · 4 min read
Why Activity Tables Need Status Fields: Beyond Start and End Times
samdeepthink
samdeepthink
Oct 9, 2026 · Backend Development

CyclicBarrier vs CountDownLatch: Who Waits? Java Concurrency Deep Dive

This article explains the key differences between Java's CyclicBarrier and CountDownLatch, focusing on which threads wait, thread lifecycle after signaling, reusability, and a practical pressure-test example using CountDownLatch to simulate concurrent requests.

CountDownLatchCyclicBarrierJava
0 likes · 8 min read
CyclicBarrier vs CountDownLatch: Who Waits? Java Concurrency Deep Dive
samdeepthink
samdeepthink
Sep 29, 2026 · Fundamentals

CountDownLatch Explained: Java Thread Synchronization via Meeting Analogy

This article explains Java's CountDownLatch synchronization tool using a meeting analogy, demonstrates its usage with a Java 17 code example simulating attendees arriving at a meeting, and describes a real-world batch translation scenario where the main thread waits for multiple concurrent translation tasks to complete.

Batch TranslationConcurrency PatternsCountDownLatch
0 likes · 7 min read
CountDownLatch Explained: Java Thread Synchronization via Meeting Analogy
samdeepthink
samdeepthink
Sep 28, 2026 · Backend Development

Java Semaphore Decoupling: Thread-Agnostic Permits vs. Lock Coupling

This article explains Java Semaphore's core decoupling property—where any thread can acquire or release permits—contrasting it with ReentrantLock's thread-owned locking, demonstrates with Java 17 code examples, and shows real-world rate-limiting applications in Sentinel, Dubbo, and Tomcat.

DecouplingJavaReentrantLock
0 likes · 8 min read
Java Semaphore Decoupling: Thread-Agnostic Permits vs. Lock Coupling
samdeepthink
samdeepthink
Sep 24, 2026 · Backend Development

Thread Starvation: Why Threads Starve and How to Fix It

This article explains thread starvation in Java concurrency, demonstrates it with a code example showing unfair lock acquisition and cumulative wait times, and provides two solutions: moving slow operations outside synchronized blocks and using ReentrantLock tryLock with timeout to bound waiting.

Concurrency ControlJava ConcurrencyReentrantLock
0 likes · 10 min read
Thread Starvation: Why Threads Starve and How to Fix It
samdeepthink
samdeepthink
Sep 23, 2026 · Backend Development

RabbitMQ Livelock: Emergency Fixes for Message Re-delivery Loops

The article explains livelock using a RabbitMQ incident where unacknowledged messages cause endless re-delivery, and describes two production fixes: immediate try-catch with ACK to stop the loop, then bug fix; and a configurable "empty consumption" switch to discard messages when replay is possible.

Message QueueProduction DebuggingRabbitMQ
0 likes · 6 min read
RabbitMQ Livelock: Emergency Fixes for Message Re-delivery Loops