Tag

Lock

0 views collected around this technical thread.

Deepin Linux
Deepin Linux
May 20, 2025 · Fundamentals

Understanding and Preventing Deadlocks in C++ Multithreaded Programming

This article explains what deadlocks are in C++ multithreaded programming, outlines their causes and four necessary conditions, presents common scenarios and code examples, and offers practical strategies such as consistent lock ordering, std::lock, std::scoped_lock, recursive mutexes, and lock hierarchies to avoid them.

C++DeadlockLock
0 likes · 20 min read
Understanding and Preventing Deadlocks in C++ Multithreaded Programming
Python Programming Learning Circle
Python Programming Learning Circle
Apr 17, 2025 · Fundamentals

Understanding Processes, Threads, and the GIL in Python

This article explains the concepts of processes and threads, describes Python's Global Interpreter Lock (GIL) and its impact on concurrency, compares the low‑level _thread module with the higher‑level threading module, and provides example code illustrating thread creation, synchronization with locks, and common pitfalls.

GILLockPython
0 likes · 5 min read
Understanding Processes, Threads, and the GIL in Python
Architect's Guide
Architect's Guide
Apr 2, 2025 · Backend Development

Implementing High‑Concurrency SecKill (Flash Sale) in SpringBoot: Locking, Transaction, and Queue Strategies

This article demonstrates how to simulate a high‑concurrency flash‑sale scenario with SpringBoot and MySQL, analyzes why naive lock‑and‑transaction code causes overselling, and presents six refined solutions—including early locking, AOP, pessimistic and optimistic database locks, blocking queues, and Disruptor queues—along with performance observations and a concise summary.

LockQueueSpringBoot
0 likes · 22 min read
Implementing High‑Concurrency SecKill (Flash Sale) in SpringBoot: Locking, Transaction, and Queue Strategies
Aikesheng Open Source Community
Aikesheng Open Source Community
Mar 5, 2025 · Databases

Overview of MySQL Transaction, Lock, and Undo Modules – Article Index

This article provides a comprehensive index of a MySQL internals series covering the transaction, lock, and undo modules, detailing each sub‑topic such as transaction initialization, two‑phase commit, various lock types, deadlock handling, and undo log management across numerous linked articles.

Database InternalsInnoDBLock
0 likes · 7 min read
Overview of MySQL Transaction, Lock, and Undo Modules – Article Index
macrozheng
macrozheng
Oct 11, 2024 · Backend Development

Does Spring Commit Before Unlock? Unraveling Transaction Timing in High‑Concurrency

This article dissects the exact moment a Spring @Transactional method commits relative to a surrounding lock, explains why committing after unlock can cause overselling, and provides source‑level debugging techniques to verify transaction start, commit, and rollback behavior in MySQL under high concurrency.

JavaLockSpring
0 likes · 21 min read
Does Spring Commit Before Unlock? Unraveling Transaction Timing in High‑Concurrency
Java Architect Essentials
Java Architect Essentials
Aug 11, 2024 · Backend Development

Why @Transactional Can Invalidate Locks in Spring and How to Fix It

This article explains how using Spring's @Transactional annotation together with explicit locks can cause unexpected concurrency issues, demonstrates the problem with sample code, analyzes why the lock becomes ineffective, and presents solutions such as separating transactional methods, using programmatic transactions, or locking the entire transaction.

JavaLockSpring
0 likes · 6 min read
Why @Transactional Can Invalidate Locks in Spring and How to Fix It
macrozheng
macrozheng
May 11, 2024 · Backend Development

When Does @Transactional Commit? Before or After Unlock?

This article explains the timing of Spring's @Transactional commit relative to lock release, analyzes why committing after unlock can cause overselling, shows how to trace the transaction lifecycle in the source code, and offers practical solutions to ensure atomicity in high‑concurrency scenarios.

JavaLockSpring
0 likes · 19 min read
When Does @Transactional Commit? Before or After Unlock?
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 6, 2024 · Fundamentals

Understanding Dart Runtime ThreadPool: Architecture, Locks, and Task Management

This article explains how Dart implements multithreading through Isolates built on a C++ ThreadPool, detailing the roles of Task and Worker objects, the lock mechanisms with Monitor and MonitorLocker, and the lifecycle and scheduling logic that powers Dart's runtime concurrency.

C++DartIsolate
0 likes · 17 min read
Understanding Dart Runtime ThreadPool: Architecture, Locks, and Task Management
Selected Java Interview Questions
Selected Java Interview Questions
Dec 28, 2023 · Databases

KeyDB Multithreaded Architecture, Connection Management, Fastlock, and Active‑Replica Mechanism

This article explains how KeyDB, a multithreaded fork of Redis, restructures the original single‑threaded design by introducing worker threads, per‑thread connection handling, a fastlock spin‑lock implementation, and an active‑replica feature that enables writable replicas with conflict‑resolution using timestamped keys.

Active-ReplicaKeyDBLock
0 likes · 9 min read
KeyDB Multithreaded Architecture, Connection Management, Fastlock, and Active‑Replica Mechanism
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 26, 2023 · Backend Development

Differences Between Java Lock Interface and synchronized Keyword

This article explains the key differences between Java's Lock interface and the synchronized keyword, covering their nature, lock acquisition and release mechanisms, fairness, ability to query lock status, usage scenarios, and includes example code demonstrating each approach.

JavaLockThread Safety
0 likes · 5 min read
Differences Between Java Lock Interface and synchronized Keyword
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 28, 2023 · Backend Development

Optimizing Spring Transaction Order to Reduce MySQL Lock Time

This article examines how executing an UPDATE before a slow SELECT within a @Transactional method in Spring can prolong MySQL write locks, and demonstrates code refactoring techniques—reordering operations and separating transactional boundaries—to improve overall system performance.

JDBCLockMySQL
0 likes · 8 min read
Optimizing Spring Transaction Order to Reduce MySQL Lock Time
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 5, 2023 · Databases

Analyzing INSERT/REPLACE‑Induced Deadlocks in MySQL InnoDB and Prevention Strategies

This article examines how INSERT, REPLACE and INSERT … ON DUPLICATE KEY UPDATE statements can cause deadlocks in MySQL InnoDB under various scenarios, explains the underlying lock types such as GAP, NEXT‑KEY and INSERT‑INTENTION locks, and offers practical recommendations to avoid them.

DeadlockINSERTInnoDB
0 likes · 16 min read
Analyzing INSERT/REPLACE‑Induced Deadlocks in MySQL InnoDB and Prevention Strategies
HelloTech
HelloTech
Jul 28, 2023 · Backend Development

Understanding Java's AbstractQueuedSynchronizer (AQS) and ReentrantLock Implementation

The article explains Java’s AbstractQueuedSynchronizer framework and how ReentrantLock uses its inner Sync classes—FairSync and NonfairSync—to manage lock acquisition via CAS, queueing, spinning, and parking, detailing the acquire/release loops, fair vs non‑fair behavior, and interview‑ready insights.

AQSBackend DevelopmentJava
0 likes · 12 min read
Understanding Java's AbstractQueuedSynchronizer (AQS) and ReentrantLock Implementation
Code Ape Tech Column
Code Ape Tech Column
Jul 25, 2023 · Backend Development

High‑Concurrency Seckill Implementation in SpringBoot: Locking Strategies and Performance Testing

This article demonstrates how to simulate a high‑concurrency flash‑sale scenario using SpringBoot, MySQL and JMeter, analyzes why naive lock‑and‑transaction code causes overselling, and presents six refined solutions—including controller‑level locking, AOP locking, pessimistic and optimistic database locks, and queue‑based approaches—along with performance test results.

AOPJMeterLock
0 likes · 20 min read
High‑Concurrency Seckill Implementation in SpringBoot: Locking Strategies and Performance Testing
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 28, 2023 · Databases

Analyzing Slow UPDATE Locks in MySQL 5.7 and Optimizing with Indexes and Optimizer Trace

The article investigates why an UPDATE statement on a MySQL 5.7 InnoDB table with RR isolation experiences high lock time, demonstrates how missing indexes cause full‑table scans and blocking, and shows how adding an index and using optimizer trace can diagnose and resolve the issue.

InnoDBLockMySQL
0 likes · 8 min read
Analyzing Slow UPDATE Locks in MySQL 5.7 and Optimizing with Indexes and Optimizer Trace
Selected Java Interview Questions
Selected Java Interview Questions
May 5, 2023 · Backend Development

High‑Frequency Java Concurrency Questions: AQS, Locks, Thread Pools, Blocking Queues, CountDownLatch, Semaphore, CopyOnWriteArrayList, and ConcurrentHashMap

This article explains the core concepts and common pitfalls of Java's AbstractQueuedSynchronizer (AQS) and its derived utilities such as ReentrantLock, ReentrantReadWriteLock, CountDownLatch, Semaphore, as well as the design and behavior of blocking queues, thread‑pool parameters, CopyOnWriteArrayList, and ConcurrentHashMap, providing code examples and practical guidance.

AQSBlockingQueueConcurrentHashMap
0 likes · 21 min read
High‑Frequency Java Concurrency Questions: AQS, Locks, Thread Pools, Blocking Queues, CountDownLatch, Semaphore, CopyOnWriteArrayList, and ConcurrentHashMap
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Mar 3, 2023 · Backend Development

Understanding Spinlocks in Java: Principles, Advantages, Use Cases, and Implementation

This article explains what a spinlock is, outlines its advantages and disadvantages, describes suitable usage scenarios, and provides a detailed Java implementation using CAS, including code examples and an explanation of the underlying CAS algorithm.

CASJavaLock
0 likes · 5 min read
Understanding Spinlocks in Java: Principles, Advantages, Use Cases, and Implementation