Tag

locking

0 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 12, 2025 · Backend Development

Why Using synchronized on a Local Variable Fails to Lock in Java Multithreading

The article demonstrates that synchronizing on a locally created object does not provide proper thread safety, shows the resulting chaotic output, and explains how moving the lock object to a class field resolves the issue, illustrated with Java code and debugging screenshots.

Javaconcurrencydebugging
0 likes · 4 min read
Why Using synchronized on a Local Variable Fails to Lock in Java Multithreading
IT Services Circle
IT Services Circle
May 10, 2025 · Backend Development

Understanding Java synchronized: Locks, Optimizations, and Example Code

This article explains how Java's synchronized keyword works, covering object and class locks, lock upgrades such as biased, lightweight, and heavyweight locks, the underlying monitor implementation, example code for a thread‑safe counter, and performance considerations for high‑concurrency scenarios.

Javaconcurrencylocking
0 likes · 7 min read
Understanding Java synchronized: Locks, Optimizations, and Example Code
Cognitive Technology Team
Cognitive Technology Team
May 5, 2025 · Fundamentals

Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)

This article examines the evolution of Java's ConcurrentHashMap, comparing the segment‑lock implementation in Java 7 with the CAS‑plus‑synchronized, bucket‑level locking and red‑black tree enhancements introduced in Java 8, covering lock mechanisms, data structures, resizing strategies, core operations, performance and suitable use cases.

ConcurrentHashMapDataStructureJava
0 likes · 11 min read
Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)
Cognitive Technology Team
Cognitive Technology Team
Apr 11, 2025 · Databases

Understanding MySQL Concurrency: Read/Write Conflicts, MVCC, and Locking Strategies

This article explains MySQL's three concurrency types—read‑read, read‑write, and write‑write—describes how InnoDB uses MVCC, shared and exclusive locks, and provides practical examples and code for handling update‑loss and write‑write conflicts with optimistic and pessimistic locking.

DatabaseMVCCMySQL
0 likes · 8 min read
Understanding MySQL Concurrency: Read/Write Conflicts, MVCC, and Locking Strategies
Cognitive Technology Team
Cognitive Technology Team
Mar 9, 2025 · Fundamentals

Understanding Concurrency Levels: Blocking, Starvation‑Free, Obstruction‑Free, Lock‑Free, and Wait‑Free in Java

The article explains five fundamental concurrency levels—Blocking, Starvation‑Free, Obstruction‑Free, Lock‑Free, and Wait‑Free—detailing their definitions, implementation mechanisms in Java, performance trade‑offs, suitable scenarios, and practical decision guidance for building high‑performance, reliable systems.

Javahigh concurrencylocking
0 likes · 6 min read
Understanding Concurrency Levels: Blocking, Starvation‑Free, Obstruction‑Free, Lock‑Free, and Wait‑Free in Java
Code Mala Tang
Code Mala Tang
Feb 20, 2025 · Fundamentals

Mastering Lock Mechanisms: From Mutexes to Distributed Locks in Python

This comprehensive guide explores why locks are essential in concurrent programming, explains the principles behind mutexes, semaphores, read‑write locks, and re‑entrant locks, provides Python code examples, discusses common pitfalls like deadlocks, and offers best‑practice strategies for production environments.

PythonSemaphoreSynchronization
0 likes · 22 min read
Mastering Lock Mechanisms: From Mutexes to Distributed Locks in Python
macrozheng
macrozheng
Feb 6, 2025 · Databases

How KeyDB Transforms Redis into a Multi‑Threaded Database

KeyDB, a Redis fork, replaces the single‑threaded architecture with a multi‑threaded model using a main thread and worker I/O threads, SO_REUSEPORT, per‑thread connection management, fastlock spin‑lock mechanisms, and active‑replica support, enabling concurrent data access and improved performance.

Connection ManagementDatabaseKeyDB
0 likes · 9 min read
How KeyDB Transforms Redis into a Multi‑Threaded Database
Aikesheng Open Source Community
Aikesheng Open Source Community
Feb 5, 2025 · Databases

Thank You, Outlook, and Review of the MySQL Core Modules Series

After publishing 50 installments of the 'MySQL Core Modules' series covering transactions, locks, and undo, the author expresses gratitude to readers and the community, outlines upcoming articles on Undo, MVCC, and Redo, and reviews past content while planning a compiled book.

Database InternalsMVCCMySQL
0 likes · 7 min read
Thank You, Outlook, and Review of the MySQL Core Modules Series
Code Ape Tech Column
Code Ape Tech Column
Jan 8, 2025 · Backend Development

Implementing High‑Concurrency Flash‑Sale (Seckill) in SpringBoot: Locking Strategies, Queue Solutions, and Performance Testing

This article demonstrates how to simulate a high‑concurrency flash‑sale scenario using SpringBoot, MySQL, Mybatis‑Plus and JMeter, analyzes the overselling problem caused by premature lock release, and presents seven solutions—including lock‑first strategies, AOP, pessimistic and optimistic locks, and queue‑based approaches—along with code samples and test results.

AOPDatabaseJMeter
0 likes · 19 min read
Implementing High‑Concurrency Flash‑Sale (Seckill) in SpringBoot: Locking Strategies, Queue Solutions, and Performance Testing
Aikesheng Open Source Community
Aikesheng Open Source Community
Nov 13, 2024 · Databases

InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED

This article examines how InnoDB acquires row‑level locks during INSERT … ON DUPLICATE KEY operations under REPEATABLE‑READ and READ‑COMMITTED isolation levels, explains the lock types on primary and unique indexes, and shows the rollback and lock‑conversion process with concrete SQL examples.

InnoDBMySQLRead Committed
0 likes · 11 min read
InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED
JD Retail Technology
JD Retail Technology
Nov 5, 2024 · Backend Development

Ensuring Inventory Consistency Under Concurrent Operations: Locking Pitfalls and Solutions

The article examines how frequent inventory adjustments in JD retail supply‑chain can suffer from concurrency issues, explains why traditional locking may fail, analyzes a real‑world case of lock misuse, and presents code‑level, database‑level, and architectural solutions to guarantee data consistency.

BackendDatabaseDistributed Lock
0 likes · 7 min read
Ensuring Inventory Consistency Under Concurrent Operations: Locking Pitfalls and Solutions
Aikesheng Open Source Community
Aikesheng Open Source Community
Oct 30, 2024 · Databases

MySQL InnoDB Deadlock Analysis: Locking Behavior and Resolution

This article reproduces a MySQL 8.0.32 InnoDB deadlock using two concurrent DELETE statements on the same secondary index, explains the lock types and lock‑wait graph, and details why the deadlock occurs and how it is resolved.

DatabaseInnoDBMySQL
0 likes · 12 min read
MySQL InnoDB Deadlock Analysis: Locking Behavior and Resolution
Aikesheng Open Source Community
Aikesheng Open Source Community
Oct 9, 2024 · Databases

Understanding InnoDB Locking: Repeatable Read vs. Read Committed Isolation Levels

This article demonstrates how InnoDB acquires different types of row and gap locks under REPEATABLE-READ and READ-COMMITTED isolation levels by creating a test table, inserting data, setting transaction isolation, executing SELECT ... FOR SHARE statements, and inspecting lock information from performance_schema.

InnoDBMySQLRead Committed
0 likes · 9 min read
Understanding InnoDB Locking: Repeatable Read vs. Read Committed Isolation Levels
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 25, 2024 · Databases

Analysis of Lock Behavior under REPEATABLE-READ and READ-COMMITTED Isolation Levels

This tutorial demonstrates, using MySQL 8.0.32 InnoDB source code, how REPEATABLE-READ and READ-COMMITTED isolation levels affect the locking behavior of SELECT ... FOR SHARE statements on primary‑key rows, including preparation, execution, and detailed lock analysis.

InnoDBMySQLRead Committed
0 likes · 7 min read
Analysis of Lock Behavior under REPEATABLE-READ and READ-COMMITTED Isolation Levels
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 18, 2024 · Databases

InnoDB Locking Behavior for Unique Index Conflicts under READ‑COMMITTED Isolation

This article examines how MySQL 8.0.32 InnoDB handles locking when inserting a row that violates a unique index under the READ‑COMMITTED isolation level, detailing the preparation steps, observed lock types, the underlying mechanism, and the final cleanup actions.

InnoDBMySQLRead Committed
0 likes · 8 min read
InnoDB Locking Behavior for Unique Index Conflicts under READ‑COMMITTED Isolation
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 11, 2024 · Databases

What Lock Is Acquired When a Primary Key Index Conflict Occurs During INSERT

This article examines how InnoDB handles row locking when an INSERT triggers a primary‑key index conflict, detailing the lock types on primary and unique indexes, the implicit‑to‑explicit lock conversion, and the role of the supremum record in the locking process.

InnoDBMySQLTransaction
0 likes · 10 min read
What Lock Is Acquired When a Primary Key Index Conflict Occurs During INSERT
Zhuanzhuan Tech
Zhuanzhuan Tech
Aug 27, 2024 · Databases

MySQL InnoDB Deadlock Analysis and Resolution Guide

This article presents a detailed walkthrough of a MySQL InnoDB deadlock case, covering background, log inspection, data preparation, reproduction steps, lock analysis, root‑cause explanation, and practical solutions to prevent and resolve similar deadlock issues.

DatabaseInnoDBMySQL
0 likes · 14 min read
MySQL InnoDB Deadlock Analysis and Resolution Guide
Aikesheng Open Source Community
Aikesheng Open Source Community
Aug 14, 2024 · Databases

Granting Table Locks and Row Locks in InnoDB

This article explains how InnoDB in MySQL 8.0.32 grants table and row locks, detailing the active versus passive acquisition, the lock‑granting algorithms for tables and rows, and the priority, weight, and FIFO rules that determine lock ordering and deadlock handling.

Database ConcurrencyInnoDBMySQL
0 likes · 11 min read
Granting Table Locks and Row Locks in InnoDB