Tag

Java Concurrency

1 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
May 16, 2025 · Backend Development

Choosing the Right Number of Threads for Java Applications: CPU Utilization and Performance

This article experimentally examines how thread count, CPU‑bound versus I/O‑bound workloads, and context‑switch overhead affect CPU utilization in Java, presents a practical formula for estimating optimal threads, and advises testing and tuning rather than relying on fixed rules.

CPU utilizationCPU-boundI/O bound
0 likes · 9 min read
Choosing the Right Number of Threads for Java Applications: CPU Utilization and Performance
macrozheng
macrozheng
May 16, 2025 · Fundamentals

Why More Threads Can Slow Down Your Java App—and How to Optimize Context Switching

This article explains how CPU time slices, hyper‑threading, and context‑switching affect multithreaded performance, outlines the costs of thread switches, and offers practical strategies such as lock‑free programming, CAS, reducing thread count, and using coroutines to improve efficiency.

CPU schedulingJava Concurrencycontext switching
0 likes · 11 min read
Why More Threads Can Slow Down Your Java App—and How to Optimize Context Switching
Top Architecture Tech Stack
Top Architecture Tech Stack
May 12, 2025 · Operations

Load Testing with Postman, Apache Bench, JMeter, and Java Concurrency Utilities

This article explains how to perform HTTP load testing using Postman, Apache Bench, JMeter, and Java concurrency classes such as CountDownLatch and Semaphore, providing step‑by‑step setup, configuration, and code examples for simulating high‑traffic scenarios.

Apache BenchCountDownLatchJMeter
0 likes · 8 min read
Load Testing with Postman, Apache Bench, JMeter, and Java Concurrency Utilities
Architect
Architect
Apr 9, 2025 · Backend Development

Merging Requests and Batch Querying in Spring Boot to Reduce Database Connections

This article explains how to merge concurrent user requests into a single batch SQL query using Java's LinkedBlockingQueue, ScheduledThreadPoolExecutor and CompletableFuture in a Spring Boot application, thereby saving database connections and improving performance under high concurrency.

Database OptimizationJava ConcurrencySpring Boot
0 likes · 13 min read
Merging Requests and Batch Querying in Spring Boot to Reduce Database Connections
macrozheng
macrozheng
Mar 19, 2025 · Backend Development

Unlock Ultra‑Low Latency with Disruptor: Architecture, Features & Tuning Guide

This article introduces the high‑performance in‑memory queue Disruptor, covering its architecture—including ring buffer, sequence, sequencer, and wait strategies—its key features such as multicast events and lock‑free concurrency, and provides practical tuning advice and a complete Java example.

DisruptorIn-Memory QueueJava Concurrency
0 likes · 12 min read
Unlock Ultra‑Low Latency with Disruptor: Architecture, Features & Tuning Guide
Sohu Tech Products
Sohu Tech Products
Feb 19, 2025 · Fundamentals

Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles

The article explains Java’s ReentrantLock implementation, contrasting fair locks that queue threads in request order with non‑fair locks that allow immediate acquisition, detailing the internal Sync, FairSync and NonfairSync classes, lock/unlock mechanisms, performance trade‑offs, and guidance on selecting the appropriate lock type.

AQSFair LockJUC
0 likes · 19 min read
Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles
IT Services Circle
IT Services Circle
Jan 9, 2025 · Backend Development

LMAX Disruptor: High‑Performance In‑Memory Queue and Its Typical Use Cases

The article introduces LMAX Disruptor, a high‑performance, lock‑free in‑memory queue for the JVM, compares it with JDK thread‑safe queues, and demonstrates five practical usage scenarios—including broadcast, log collection, chain of responsibility, multi‑task coordination, and multi‑consumer groups—through detailed Java code examples.

DisruptorJava Concurrencybackend
0 likes · 10 min read
LMAX Disruptor: High‑Performance In‑Memory Queue and Its Typical Use Cases
Code Ape Tech Column
Code Ape Tech Column
Dec 24, 2024 · Backend Development

Understanding the Disruptor In-Memory Message Queue: Architecture, Features, and Tuning

This article introduces the Disruptor in‑memory message queue, explains its core components such as Ring Buffer, Sequence, Sequencer and Wait Strategies, describes its distinctive features like multicast events and lock‑free concurrency, and provides tuning guidelines and a complete Java example.

DisruptorIn-Memory QueueJava Concurrency
0 likes · 11 min read
Understanding the Disruptor In-Memory Message Queue: Architecture, Features, and Tuning
Top Architect
Top Architect
Nov 5, 2024 · Backend Development

Understanding ForkJoinPool: Principles, Implementation, and Performance Evaluation

This article explains the Fork/Join model and Java's ForkJoinPool, covering divide‑and‑conquer theory, task splitting, core APIs, code examples, common pitfalls, performance testing, and best‑practice recommendations for high‑concurrency computing.

ForkJoinPoolJava ConcurrencyParallel Computing
0 likes · 25 min read
Understanding ForkJoinPool: Principles, Implementation, and Performance Evaluation
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 10, 2024 · Backend Development

Boost SpringBoot Performance: Parallel REST Calls with CompletableFuture

This tutorial demonstrates how to use Java's CompletableFuture in SpringBoot 2.7.18 to parallelize multiple external REST API calls, covering code implementation, exception handling, and timeout management to improve response time and scalability.

CompletableFutureJava ConcurrencySpringBoot
0 likes · 9 min read
Boost SpringBoot Performance: Parallel REST Calls with CompletableFuture
Sohu Tech Products
Sohu Tech Products
Jul 17, 2024 · Backend Development

Java Thread Pool: Working Mechanism, States, and Rejection Policies

Java thread pools efficiently manage and reuse threads by applying a producer‑consumer model, transitioning through RUNNING, SHUTDOWN, STOP, and TERMINATED states, handling task queues, and employing configurable rejection policies such as Abort, CallerRuns, Discard, and DiscardOldest, while improving performance, resource utilization, and stability across web servers, asynchronous processing, and other concurrent workloads, distinct from connection pools which manage database connections.

JavaJava ConcurrencyPerformance Optimization
0 likes · 12 min read
Java Thread Pool: Working Mechanism, States, and Rejection Policies
Selected Java Interview Questions
Selected Java Interview Questions
Nov 22, 2023 · Backend Development

Thread Pool Pitfalls and Best Practices in Java Backend Development

This article analyzes a real production incident caused by improper thread‑pool usage, explains common misconceptions about core parameters, demonstrates faulty code examples, and provides concrete recommendations for configuring thread pools, handling timeouts, and avoiding deadlocks in Java backend services.

CompletableFutureJava ConcurrencySpring Async
0 likes · 14 min read
Thread Pool Pitfalls and Best Practices in Java Backend Development
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Nov 19, 2023 · Backend Development

Mastering Pessimistic and Optimistic Locks in Spring Boot 2.6.12

This article explains the concepts of pessimistic and optimistic locking, compares their use cases, demonstrates version‑based and CAS implementations, and shows a complete Spring Boot example with retry‑enabled optimistic lock handling using AOP and custom annotations.

JPAJava ConcurrencySpring Boot
0 likes · 12 min read
Mastering Pessimistic and Optimistic Locks in Spring Boot 2.6.12
macrozheng
macrozheng
Oct 27, 2023 · Backend Development

Unlock 20× Faster Java Concurrency with JDK21 Virtual Threads

This article explains JDK21's new virtual threads, compares them with traditional thread pools through a 10,000‑thread benchmark, shows over 20‑fold performance gains, and provides practical code examples and configuration tips for Java developers.

JDK21Java ConcurrencyPerformance Test
0 likes · 8 min read
Unlock 20× Faster Java Concurrency with JDK21 Virtual Threads
Top Architect
Top Architect
Oct 8, 2023 · Backend Development

Merging Backend Requests in SpringBoot to Reduce Database Connections

This article explains how to merge multiple backend requests in a SpringBoot application using a blocking queue, ScheduledThreadPoolExecutor, and CompletableFuture to batch database queries, reduce connection overhead, handle high concurrency, and includes full Java code examples and performance testing.

Java ConcurrencySpringBootbackend optimization
0 likes · 15 min read
Merging Backend Requests in SpringBoot to Reduce Database Connections
Architect
Architect
Oct 1, 2023 · Backend Development

Batch Request Merging in Spring Boot to Reduce Database Connections

This article demonstrates how to merge multiple user‑info requests on the server side using a blocking queue, ScheduledThreadPoolExecutor, and CompletableFuture in Spring Boot, thereby consolidating SQL queries into a single batch call to save database connection resources while handling high concurrency.

CompletableFutureJava ConcurrencyLinkedBlockingQueue
0 likes · 13 min read
Batch Request Merging in Spring Boot to Reduce Database Connections
macrozheng
macrozheng
Jul 7, 2023 · Backend Development

Boost Java Concurrency: How Project Loom’s Virtual Threads Supercharge Spring Boot

This article explains Project Loom’s virtual threads, shows how to enable them in a Spring Boot 3.1 application with Java 20, provides code samples and performance test results that demonstrate dramatically higher throughput under high concurrency.

Java ConcurrencyProject LoomSpring Boot
0 likes · 8 min read
Boost Java Concurrency: How Project Loom’s Virtual Threads Supercharge Spring Boot
Java Architecture Diary
Java Architecture Diary
Jun 21, 2023 · Backend Development

Boost Java Concurrency with Project Loom: A Hands‑On Guide to Virtual Threads

Learn how Project Loom’s virtual threads can replace heavyweight OS threads in Java Spring Boot applications, enabling one‑thread‑per‑request models, improving throughput under high concurrency, with step‑by‑step setup, code samples, and performance comparisons across 100‑, 300‑ and 500‑thread tests.

Java ConcurrencyProject LoomSpring Boot
0 likes · 7 min read
Boost Java Concurrency with Project Loom: A Hands‑On Guide to Virtual Threads
HomeTech
HomeTech
Jun 14, 2023 · Backend Development

Design and Implementation of a Task Orchestration Framework for Business Systems

This article introduces the background, core concepts, architecture, and implementation details of a lightweight Java task orchestration framework that simplifies complex business workflows by managing task dependencies, parallel execution, and error handling, thereby improving development efficiency and system maintainability.

Java ConcurrencyWorkflow Enginebackend development
0 likes · 25 min read
Design and Implementation of a Task Orchestration Framework for Business Systems
360 Quality & Efficiency
360 Quality & Efficiency
Mar 31, 2023 · Backend Development

Understanding ThreadPoolExecutor: Key Parameters and Source Code Analysis

This article explains the purpose of using thread pools in Java projects, details each important parameter of ThreadPoolExecutor, and provides a thorough walkthrough of its core source code, including constructors, task submission, execution, shutdown mechanisms, and internal worker management, helping developers understand and debug thread pool behavior.

ExecutorServiceJava ConcurrencyThreadPoolExecutor
0 likes · 17 min read
Understanding ThreadPoolExecutor: Key Parameters and Source Code Analysis