Tagged articles
Producer-Consumer
51 articles · Page 1 of 1
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.
ConcurrencyConditionJava
0 likes · 14 min read

This article explains the classic producer-consumer synchronization problem using a milk tea shop analogy, detailing three solutions—semaphores, monitors, and message passing—with code examples, constraints, variants, and real-world applications like print queues and web servers.
ConcurrencyMultithreadingOperating Systems
0 likes · 14 min read

This article explains PV operations (semaphores) using traffic light analogies, covering P/V definitions, mutual exclusion, synchronization, resource counting, the producer-consumer problem with complete code walkthrough, and critical pitfalls like deadlock from incorrect P-ordering.
DijkstraOperating SystemsPV operations
0 likes · 11 min read

This article explains the parallel loading technique used in the H5 instant SDK to accelerate page startup, details the three resource‑handoff scenarios that cause synchronization challenges, reviews the early simple design and its drawbacks, and presents an optimized producer‑consumer model with fair locks and bridge streams to eliminate wasteful waiting and memory consumption.
Fair LockH5 instant SDKJava Concurrency
0 likes · 31 min read

This article explains the concept, core features, basic usage, member functions, best practices, and real-world scenarios of C++11's std::condition_variable, including a complete producer‑consumer example and comparisons with atomic operations.
C++MultithreadingProducer-Consumer
0 likes · 8 min read

Python developers often create simple queues with lists using append and pop(0), but this approach has O(n) complexity and thread‑safety issues; the article explains how the built‑in queue module provides efficient, thread‑safe FIFO, LIFO, and priority queues, with code examples for single‑thread and multithreaded task processing.
MultithreadingProducer-ConsumerPython
0 likes · 5 min read

This comprehensive guide introduces Apache Kafka's core concepts—topics, partitions, producers, consumers, and APIs—covers common use cases, walks through downloading, installing, and configuring a single‑node broker, demonstrates multi‑broker clustering, and explains how to use Kafka Connect for data import and export.
Producer-Consumerdistributed-streaminginstallation
0 likes · 26 min read

This article explains the concepts, usage conditions, execution flow, internal mechanisms, and best‑practice guidelines for Java's wait() and notify() methods, illustrated with a producer‑consumer example and code snippets for safe thread coordination.
ConcurrencyJavaProducer-Consumer
0 likes · 6 min read

This article explains the concepts, characteristics, and ideal scenarios for unbounded and bounded queues in Java, provides step‑by‑step Maven setup and complete code examples for asynchronous task scheduling, event‑driven processing, and API rate‑limiting, and highlights practical considerations such as resource management and performance.
Bounded QueueConcurrencyJava
0 likes · 23 min read

The article explains the Disruptor—an intra‑process, lock‑free, array‑based queue that achieves millions of operations per second—by covering its core concepts, demo code, source‑code mechanics, performance optimizations such as pre‑allocation and false‑sharing avoidance, and real‑world Vivo iTheme applications with best‑practice tips.
DisruptorJavaProducer-Consumer
0 likes · 29 min read

This article explains the classic producer‑consumer synchronization challenge, describes its importance in concurrent programming, and provides two complete C implementations—one using mutexes and condition variables and another using semaphores—along with detailed code and sample output.
C++ConcurrencyMutex
0 likes · 9 min read

This article explains why high‑concurrency systems need an asynchronous queue, walks through a producer‑consumer design implemented with Go and Gin, shows a complete code demo with configurable workers and capacity, and provides benchmark instructions to evaluate its performance.
EasyQueueGinGo
0 likes · 13 min read

This article introduces the open‑source Java library Disruptor, explains its core concepts such as RingBuffer, Sequence, and WaitStrategy, and provides a step‑by‑step demo with Maven dependency, event model, factory, handler, and a Spring‑Boot test illustrating high‑throughput producer‑consumer messaging.
DisruptorJavaProducer-Consumer
0 likes · 11 min read

This guide explains RabbitMQ fundamentals—including brokers, virtual hosts, connections, channels, exchanges, queues, producers, and consumers—covers common messaging patterns, provides step‑by‑step Java code for creating connections, declaring exchanges and queues, publishing and consuming messages, handling acknowledgments and confirmations, and shows how to integrate RabbitMQ with Spring Boot.
AMQPJavaMessage Queue
0 likes · 17 min read

This article introduces the high‑performance Java library Disruptor, explains its core concepts such as Ring Buffer, Sequence, and Wait Strategy, and provides a step‑by‑step demo with Maven configuration, code examples, and test results to help developers implement fast, lock‑free producer‑consumer queues.
ConcurrencyDisruptorJava
0 likes · 12 min read

This article introduces the open‑source Disruptor framework, explains its core concepts such as Ring Buffer, Sequencer, and Wait Strategies, and provides a step‑by‑step Java demo—including Maven setup, event factory, handlers, and a test case—to illustrate building a high‑throughput, low‑latency in‑memory message queue.
DisruptorJavaMessage Queue
0 likes · 11 min read

This article provides a comprehensive guide to Apache Kafka, covering its typical use cases, fundamental terminology, step‑by‑step installation and environment preparation, detailed configuration of brokers and topics, cluster deployment, producer‑consumer commands, and a Java client example for sending messages.
Distributed MessagingJava ClientProducer-Consumer
0 likes · 21 min read

This article explains Kafka's fundamentals, including topics, partitions, brokers, replication, producer‑consumer workflow, consumer groups, offset management, and common exception handling, while providing code examples and diagrams to help developers understand and effectively use this distributed messaging system.
Distributed SystemsJavaKafka
0 likes · 21 min read

This article demonstrates how to generate, read, and analyze a 10 GB file of age statistics on a 4 GB RAM, 2‑core machine using Java, comparing a single‑threaded counting method with a producer‑consumer multi‑threaded approach that dramatically improves CPU utilization and reduces processing time.
JavaMemory ManagementMultithreading
0 likes · 11 min read

This guide introduces RabbitMQ, explains how to install it with Docker, covers basic and advanced producer/consumer usage including acknowledgments, durability, QoS, bindings, and exchange types, and discusses a typical Python reconnection problem, providing a practical overview for backend developers.
ExchangeMessage QueueProducer-Consumer
0 likes · 5 min read

The article examines Android's DropBoxManagerService architecture, its configurable file retention policies, naming conventions, atomic operations, and broadcast mechanisms, then applies these patterns to propose a client‑side log management system using a producer‑consumer model with prioritized temporary storage, rename‑based reporting, and FileObserver‑driven collection respecting network, data, timing, priority, and battery constraints.
AndroidDropBoxManagerServiceProducer-Consumer
0 likes · 14 min read

This article walks through generating a 10 GB file of age values, reading it line‑by‑line on a 4 GB RAM, 2‑core machine, measuring single‑thread performance, then redesigning the pipeline with a producer‑consumer model, blocking queues and multithreaded string splitting to dramatically boost CPU utilization and cut processing time while managing memory consumption.
File ProcessingJavaMultithreading
0 likes · 12 min read

The article explains how to achieve million‑level concurrency in Java by focusing on three fundamental problems—task division, synchronization, and mutual exclusion—using real‑world analogies, diagrams, and concrete code examples to illustrate proper multithreaded design.
ConcurrencyJavaMultithreading
0 likes · 11 min read

This tutorial explains the producer‑consumer principle using RabbitMQ, provides a reusable PHP base class for queue connections, and demonstrates how to create service and client classes to send and receive messages, followed by step‑by‑step instructions to run the code and view the queue.
Message QueuePHPProducer-Consumer
0 likes · 3 min read

This article explains how to generate a 10 GB file of age data, read it efficiently on a machine with limited memory, and use both single‑threaded and multithreaded Java techniques—including a producer‑consumer model and divide‑and‑conquer—to identify the age that appears most frequently, while analyzing performance, memory usage, and CPU utilization.
File ProcessingJavaMemory Management
0 likes · 13 min read

This article walks through generating a 10GB file of age data, reading it line‑by‑line on a machine with only 4GB RAM, and compares a single‑thread counting approach with a multithreaded producer‑consumer design, showing performance gains, memory usage, and practical tips.
AlgorithmFile I/OJava
0 likes · 18 min read

The article presents a complete Java solution for generating, reading, and analyzing a 10 GB file of age values (18‑70) on a 4 GB RAM, 2‑core PC, comparing single‑threaded counting with a producer‑consumer multithreaded design that dramatically improves CPU utilization and reduces total processing time.
AlgorithmJavaMultithreading
0 likes · 20 min read

This article explains the root causes of thread‑safety problems in Java producer‑consumer scenarios, demonstrates how race conditions and deadlocks arise, and provides step‑by‑step solutions using synchronized blocks, wait/notify, notifyAll, and explicit Lock with Condition objects.
ConcurrencyDeadlockJava
0 likes · 20 min read

This article explains how the Austin Java backend project applies several classic design patterns—including Chain of Responsibility, Template Method, Builder, Strategy, Producer‑Consumer, Singleton, and Proxy—detailing their benefits, drawbacks, and specific code locations for each pattern.
BuilderChain of ResponsibilityDesign Patterns
0 likes · 6 min read

This article introduces the high‑performance Disruptor library, explains its background, core concepts such as RingBuffer, Sequence, Sequencer, and WaitStrategy, and provides a complete Spring Boot‑based Java demo with code snippets illustrating producers, consumers, and configuration.
DisruptorJavaProducer-Consumer
0 likes · 12 min read

This article explains the producer‑consumer concurrency model, its benefits such as decoupling and buffering, and demonstrates both unbuffered and buffered channel implementations in Go with complete code examples and a real‑world order‑processing scenario.
ConcurrencyGoProducer-Consumer
0 likes · 9 min read

This article introduces RabbitMQ's core concepts, compares AMQP with JMS, outlines its key features, and demonstrates four working patterns—work queue, routing, publish/subscribe, and wildcard—through detailed Java producer and consumer code examples.
AMQPBackendJava
0 likes · 7 min read

This article explains the classic producer‑consumer concurrency model, its advantages of decoupling, asynchrony and speed balancing, and demonstrates how Java’s wait(), notify() and notifyAll() mechanisms are used to coordinate producer and consumer threads with sample code implementations.
JavaProducer-Consumerwait-notify
0 likes · 9 min read

Coroutines, also known as micro‑threads, allow a single thread to pause and resume functions, offering higher efficiency than traditional multithreading by eliminating context‑switch overhead and lock contention, with Python’s generator‑based implementation enabling lock‑free producer‑consumer patterns and seamless multi‑core utilization via processes.
ConcurrencyProducer-ConsumerPython
0 likes · 7 min read

This article explains a high‑performance ring buffer implementation for a multi‑threaded producer‑consumer model in Java, covering design choices, atomic index handling, benchmark results, and further optimizations such as cache‑line padding and multi‑buffer sharding.
Java ConcurrencyProducer-Consumeratomicinteger
0 likes · 10 min read

This article explains several classic Java concurrency patterns—including various Singleton implementations, the Future and FutureTask mechanisms, producer‑consumer queues, Master‑Worker coordination, and the ForkJoin framework—providing code examples and practical usage notes for each.
ForkJoinFutureMultithreading
0 likes · 14 min read

This article explains the producer‑consumer pattern, why it is needed, and demonstrates two Python implementations using a standard Queue and a JoinableQueue, including full code samples, execution results, and discussion of graceful termination for multiple consumers.
ConcurrencyJoinableQueueProducer-Consumer
0 likes · 8 min read

This article reviews the historical evolution of Apache Kafka versions, explains the versioning scheme, highlights major features introduced in each release from 0.7.x to 2.x, and provides practical recommendations for selecting an appropriate Kafka version.
Producer-ConsumerVersioningbig data
0 likes · 9 min read

This article uses everyday analogies to explain thread coordination, then demonstrates practical Java examples for stopping threads with flags, pausing/resuming, joining, barrier synchronization, exchanging tools, and phaser control, and finally ties them together with the classic producer‑consumer problem using locks and conditions.
JavaMultithreadingProducer-Consumer
0 likes · 21 min read

Android’s BufferQueue, the core producer‑consumer mechanism behind the display pipeline, manages GraphicBuffer slots through explicit FREE‑DEQUEUED‑QUEUED‑ACQUIRED transitions, using shared memory and Binder to let producers (e.g., Views, MediaCodec) enqueue frames and consumers (e.g., SurfaceFlinger) acquire and release them efficiently.
AndroidBufferQueueGraphics
0 likes · 16 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 how the Disruptor framework achieves ultra‑low latency and high throughput in Java by using a ring‑buffer based producer/consumer model, detailing its architecture, sequencing algorithm, wait strategies, and practical code examples for both publishing and processing events.
ConcurrencyDisruptorJava
0 likes · 16 min read

This article explains Kafka’s core concepts—including producers, consumers, topics, partitions, brokers, and consumer groups—describes its distributed architecture with leader‑follower replication, and provides three hands‑on kafka‑python experiments that demonstrate basic messaging, fault‑tolerant consumer groups, and offset management for reliable consumption.
Consumer GroupKafkaProducer-Consumer
0 likes · 9 min read

This tutorial shows how to combine Python's threading and Queue modules to build a producer‑consumer multithreaded downloader for Tushare stock data, dramatically reducing download time from hours to under one hour.
MultithreadingProducer-ConsumerPython
0 likes · 4 min read

This article explains the producer‑consumer and publish‑subscribe messaging patterns, introduces RabbitMQ’s core concepts such as exchanges, queues, routing keys, and reliability mechanisms, and demonstrates how to apply these patterns to data ingestion and event distribution scenarios with practical diagrams.
Backend ArchitectureMessage QueueMessaging Patterns
0 likes · 9 min read

This article explains Kafka's core concepts and compares producer‑consumer and publish‑subscribe models, illustrating how to apply each pattern for data ingestion and event distribution in distributed backend systems, and offers practical design alternatives when Kafka’s native capabilities fall short.
Backend ArchitectureKafkaMessage Queue
0 likes · 10 min read

This article explains the classic producer‑consumer problem in Java, demonstrates initial implementations using wait/notify with a single producer and consumer, analyzes issues that arise with multiple threads, and presents step‑by‑step code refinements—including while‑loops and notifyAll—to achieve correct multithreaded synchronization.
Producer-ConsumernotifyAllthread synchronization
0 likes · 9 min read

Distributed queue programming treats a queue as a fundamental, cross‑process abstraction, guiding developers to select synchronous or asynchronous, decoupled, persistent messaging solutions and offering four core models—point‑to‑point, producer‑consumer, publish‑subscribe, and MVC—while the article illustrates real‑world designs for billing, cache updates, and ticket processing.
Producer-Consumerarchitecturebackend development
0 likes · 22 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

This article explains how to receive immediate notifications when new items are added to a Redis set by leveraging a blocking list as a helper, avoiding polling and implementing a producer‑consumer pattern with atomic transactions.
Blocking ListProducer-ConsumerRedis
0 likes · 3 min read


21CTOSep 14, 2015 · Backend Development
This article explains Apache Kafka's distributed publish‑subscribe design, core components, storage model, ZooKeeper coordination, performance benchmarks against ActiveMQ and RabbitMQ, and provides Java producer and consumer code examples for building high‑throughput messaging applications.
Apache KafkaDistributed MessagingMessage Queue
0 likes · 16 min read
