Tagged articles
BlockingQueue
39 articles · Page 1 of 1
The article dissects how Disruptor’s ring‑buffer architecture outperforms traditional BlockingQueue by eliminating lock contention, dynamic allocation, and cache‑line interference through pre‑allocated zero‑copy buffers, CAS‑based sequencing, cache‑line padding, batch processing, and tailored wait strategies, achieving millions of TPS.
BlockingQueueCache line paddingDisruptor
0 likes · 13 min read

This article provides a thorough, source‑level walkthrough of Java's ThreadPoolExecutor, covering its core design, state machine, seven key parameters, task‑submission flow, worker creation, execution loop, rejection policies, common pool variants, and interview‑ready explanations of the execute() process.
BlockingQueueConcurrencyExecutorService
0 likes · 10 min read

The article explains why Java's ThreadPoolExecutor places tasks into a queue before creating non‑core threads, discusses the cost of thread creation and CPU contention, illustrates the design with a bank‑counter analogy, and shows how Tomcat customizes the queue to prioritize thread creation for low‑latency web workloads.
BlockingQueueJava ConcurrencyTaskQueue
0 likes · 8 min read

The article breaks down a common Netease interview task—hand‑coding a BlockingQueue in five minutes—by explaining the underlying lock‑and‑condition mechanism, the relevant design patterns and principles, common pitfalls such as spurious wakeups, and provides a concise, 50‑line Java implementation with step‑by‑step commentary.
BlockingQueueJava ConcurrencyReentrantLock
0 likes · 20 min read

This guide compiles the most common Java thread‑pool interview questions, explains why and how thread pools are used, details the core parameters and execution flow of ThreadPoolExecutor, explores internal locks, usage patterns, monitoring, rejection policies, common pitfalls, and introduces the DynamicTp management framework.
BlockingQueueJUCJava
0 likes · 32 min read

This article explains Java's DelayQueue—its core features, the Delayed interface, essential operations, internal implementation, and practical code examples for basic usage, asynchronous scheduling, and cache expiration—while highlighting best‑practice tips and common pitfalls.
BlockingQueueConcurrencyDelayQueue
0 likes · 10 min read

The article recounts a real production incident where a recent deployment triggered loss of third‑party order data, traces the root cause to an improperly configured ThreadPoolExecutor that used a local memory queue, and walks through the systematic investigation and remediation steps.
BackendBlockingQueueConcurrency
0 likes · 6 min read

This article provides an in‑depth exploration of Java’s concurrent collection classes, covering the design and implementation of ConcurrentHashMap, ConcurrentLinkedQueue, and the seven blocking queue variants, complete with code analysis, performance considerations, and practical usage scenarios for high‑throughput multithreaded applications.
BlockingQueueConcurrentHashMapConcurrentLinkedQueue
0 likes · 50 min read

This guide explains why standard Java collections are not thread‑safe, introduces their concurrent counterparts such as Vector, ConcurrentHashMap, and various BlockingQueue implementations, and provides concrete code examples and usage patterns for safe multi‑threaded programming.
BlockingQueueConcurrencyConcurrentHashMap
0 likes · 12 min read

This article explores Java's thread communication techniques—including the basic wait/notify mechanism, advanced Lock and Condition usage, and the thread‑safe BlockingQueue—providing detailed explanations, producer‑consumer examples, and additional concurrency utilities like CountDownLatch, illustrating how to coordinate threads efficiently in multithreaded applications.
BlockingQueueConcurrencyCondition
0 likes · 18 min read

This article walks through Java thread‑pool queue options—LinkedBlockingQueue, SynchronousQueue, LinkedBlockingDeque, and PriorityBlockingQueue—explaining their characteristics, demonstrating code examples, and showing how to build multi‑priority executors with concrete output analysis.
BlockingQueueConcurrencyJava
0 likes · 12 min read

This article explains what a queue is, classifies Java queue implementations—including blocking, non‑blocking, and double‑ended queues—provides detailed descriptions of each type, and offers code snippets and usage scenarios to help developers choose the right queue for their applications.
BlockingQueueConcurrentQueueDataStructure
0 likes · 6 min read

This article introduces Java thread pools, explaining their purpose, creation using ThreadPoolExecutor, execution flow, advantages such as resource reuse and management, common blocking queues, rejection policies, and provides multiple code examples of various pool types and a comprehensive monitoring example.
BlockingQueueConcurrencyExecutorService
0 likes · 11 min read

Blocking queues are thread‑safe data structures in Java that support blocking operations, enabling producer‑consumer coordination; this article explains their definition, differences from List/Set and regular queues, various implementations such as ArrayBlockingQueue and LinkedBlockingQueue, core methods like take and put, and bounded versus unbounded capacities.
BlockingQueueConcurrencyDataStructure
0 likes · 11 min read

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.
AQSBlockingQueueConcurrency
0 likes · 21 min read

The article explains how AsyncAppender uses a BlockingQueue with a default size of 256, how an oversized queue can cause OOM, how the discardingThreshold can lead to loss of TRACE/DEBUG/INFO logs, and provides configuration tips such as adjusting queueSize, setting discardingThreshold to zero, or enabling neverBlock to avoid blocking.
AsyncAppenderBlockingQueueLogback
0 likes · 5 min read

This article provides an in-depth overview of Java concurrency, covering thread creation, lifecycle, synchronization mechanisms such as locks, semaphores, barriers, atomic classes, concurrent collections, executor frameworks, fork/join, CompletableFuture, and various blocking queues, with code examples and implementation details.
BlockingQueueConcurrencyExecutorService
0 likes · 52 min read

This article explains why using ThreadPoolExecutor directly is preferred over Executors, details the thread pool's purpose, internal architecture, task handling flow, state management, API parameters, queue choices, rejection policies, sizing formulas, and provides practical code examples for custom thread pool implementations.
BlockingQueueCustomThreadFactoryExecutorService
0 likes · 22 min read

This article provides a thorough, English‑language overview of Java's Queue hierarchy, detailing the 18 concrete queue classes, their inheritance relationships, core methods, blocking variants, deque and transfer semantics, and practical code examples for each implementation.
BlockingQueueConcurrencyJava
0 likes · 27 min read

This article explains the different blocking queue implementations—ArrayBlockingQueue, LinkedBlockingQueue, SynchronousQueue, and PriorityBlockingQueue—used by Java thread pools, describing their structures, behavior, fairness settings, and performance characteristics for concurrent task execution.
ArrayBlockingQueueBackendBlockingQueue
0 likes · 6 min read

This article explains how Java thread pools work, clarifies common misconceptions about core thread creation, details the role of BlockingQueue, and provides practical guidelines for sizing core, max threads, and queue capacity based on concurrency and GC considerations.
BlockingQueueConcurrencyperformance
0 likes · 11 min read


JavaEdgeApr 28, 2021 · Backend Development
The article explains the role of Java's Condition interface as a monitor's condition variable, contrasts it with synchronized's wait/notify, and walks through using two Condition objects to implement a blocking queue that handles empty and full states, illustrating key await/signal patterns.
BlockingQueueConditionJava
0 likes · 3 min read

This article explains the inner workings of Java thread pools, clarifies common misconceptions about core pool sizing, BlockingQueue behavior, concurrency calculation, and runtime factors such as GC, providing practical guidance and code examples for correctly configuring thread pools in backend systems.
BlockingQueueConcurrencyJVM
0 likes · 12 min read

This article explains the fundamentals of queues and blocking queues, describes how Java's java.util.concurrent.BlockingQueue works, outlines its main methods and common implementations, and provides a complete custom BlockingQueue source code example for multithreaded producer‑consumer scenarios.
BlockingQueueConcurrencyJava
0 likes · 10 min read

This article provides an in‑depth overview of Java's Queue hierarchy, covering 18 concrete queue classes, their inheritance relationships, core methods, blocking behavior, real‑world analogies, and code examples, making it the most detailed reference on Java queues available today.
BlockingQueueDataStructureJava
0 likes · 29 min read

This article provides an in‑depth, illustrated overview of Java's Queue hierarchy, covering 18 concrete queue classes, their inheritance relationships, core methods, blocking and non‑blocking variants, practical usage examples, and code snippets to help developers master queue-based data structures and concurrency utilities.
BlockingQueueConcurrencyJava
0 likes · 26 min read

This article provides a comprehensive overview of Java's concurrent queue implementations, explaining the differences between blocking and non‑blocking queues, their underlying mechanisms, typical use‑cases, and code examples for classes such as ArrayBlockingQueue, LinkedBlockingQueue, PriorityBlockingQueue, DelayQueue, SynchronousQueue, LinkedTransferQueue, and LinkedBlockingDeque.
BlockingQueueConcurrencyJUC
0 likes · 16 min read

This article categorizes the tools in java.util.concurrent, explains the six major groups of JUC utilities, dives deep into the design and behavior of various blocking and non‑blocking queues, shows their core methods, typical use‑cases, and provides code examples for practical implementation.
BlockingQueueJUCThreadPool
0 likes · 15 min read

This article provides a comprehensive guide to common Java multithreading interview questions, covering thread ordering with join, lock vs synchronized, read‑write locks, wait vs sleep, blocking queues, producer‑consumer patterns, deadlock detection, thread dumps, thread states, and immutable objects, all illustrated with runnable code samples.
BlockingQueueConcurrencyJava
0 likes · 33 min read

This article provides a comprehensive overview of Java's LinkedBlockingQueue, covering its FIFO behavior, internal linked‑list structure, concurrency controls with separate put and take locks, detailed method implementations, and a multithreaded example demonstrating safe usage versus non‑thread‑safe alternatives.
BlockingQueueConcurrencyDataStructure
0 likes · 14 min read

This article explains the design, thread‑safety mechanisms, internal data structures, and core methods of Java's ArrayBlockingQueue, illustrating its creation, insertion, removal, and iteration with detailed code examples and a practical multithreaded demo.
ArrayBlockingQueueBlockingQueueConcurrency
0 likes · 13 min read

This article walks through the classic Java producer‑consumer synchronization challenge, shows its traditional lock‑based solution, then demonstrates modern approaches using BlockingQueue and ExecutorService thread pools to simplify code, improve reliability, and avoid common pitfalls like deadlocks and thread starvation.
BlockingQueueConcurrencyJava
0 likes · 15 min read

This article explains the internal design of Java's LinkedBlockingDeque, a double‑ended blocking queue built on a linked list, covering its class hierarchy, core fields, insertion and removal methods, and the lock‑based concurrency mechanisms that enable FIFO and FILO operations.
BlockingQueueConcurrencyJava
0 likes · 8 min read

LinkedTransferQueue, introduced in JDK 7, combines the capacity of traditional BlockingQueues with the lock‑free behavior of SynchronousQueue, using a sophisticated node‑based algorithm that matches producers and consumers without locking the whole queue, offering high‑performance concurrent data transfer.
BlockingQueueConcurrencyJava
0 likes · 16 min read

This article provides a comprehensive analysis of Java's SynchronousQueue, detailing its unique zero-capacity behavior, differences from other BlockingQueue implementations, internal structures such as TransferQueue and TransferStack, fair and non‑fair modes, and the core transfer algorithm with code examples.
BlockingQueueConcurrencyJava
0 likes · 19 min read

This article explains Java's DelayQueue—a blocking queue that releases elements only after their delay expires—covering its primary use cases, core components like ReentrantLock, Condition, and PriorityQueue, the Delayed interface, internal structure, and detailed implementations of the offer() and take() methods, including a discussion of potential memory‑leak pitfalls.
BlockingQueueConcurrencyDelayQueue
0 likes · 7 min read

This article explains the internal design of Java’s ArrayBlockingQueue—a fixed‑size, FIFO blocking queue that uses a ReentrantLock and Condition objects to coordinate producers and consumers, detailing its fields, fairness option, and the concrete implementations of add, offer, poll, and take methods.
ArrayBlockingQueueBlockingQueueConcurrency
0 likes · 10 min read

This article introduces the java.util.concurrent package introduced since JDK 5, explains the five thread‑pool creation methods, demonstrates how to use Runnable and Callable, details BlockingQueue operations and implementations, and summarizes best practices for building robust, high‑concurrency Java applications.
BlockingQueueConcurrencyJava
0 likes · 10 min read

The article explains how to design a producer‑consumer model using Java's BlockingQueue, customize ThreadPoolExecutor's rejection policies—especially replacing the default AbortPolicy with a blocking strategy via a custom RejectedExecutionHandler—to safely handle full queues and improve concurrency control.
BlockingQueueConcurrencyJava
0 likes · 5 min read
