Synchronizing Goroutines with Go's sync.Cond Condition Variables
Condition variables in Go, represented by the sync.Cond type, serve as critical coordination primitives for concurrent programs. They do not operate independently; rather, they are strict coupled with a locking mechanism to manage state transitions and safely pause or resume goroutines.
The core purpose of a condition variable is to allow gorou ...
Posted on Sat, 22 Aug 2026 16:10:24 +0000 by Katmando
Understanding Thread Pool: Why Idle Non-Core Threads Are Not Immediately Recycled
Recently, a friend asked me a question on WeChat. He said: "WhyBro, are you there?"
I replied: "What's up?"
He quickly threw out a question.
I took a casual glance and thought this question was very simple.
But it turned out there was a hidden article behind it.
The story starts with this question:
The thread pool configura ...
Posted on Fri, 21 Aug 2026 16:02:44 +0000 by sciencebear
Exploring NSQ Source Code: Key Concepts and Implementation
Deployment on Windows
Despite being primarily developed for Unix-like systems, NSQ can be deployed and tested on Windows. A guide exists for installing NSQ on Windows, which details the steps to launch nsqd and connect it to nsqlookupd. Once the services are running, nsq_to_file can be used to write messages to nsqd, with appropriate logs confi ...
Posted on Sun, 16 Aug 2026 16:18:11 +0000 by Spiz
Concurrency Edge Cases: Thread Pool Saturation and Transaction-Lock Semantics
Scenario 1: Unpredictable Thread Pool Rejection in Batch Processing
Developers often combine thread pools with coordination utilities like CountDownLatch to process data in chunks. On the surface, the implementation appears flawless. However, under specific conditions, this pattern can trigger intermittent RejectedExecutionException errors, baf ...
Posted on Sun, 16 Aug 2026 16:07:35 +0000 by tazz
Python Concurrent Programming with Multiprocessing
Operating System Role
An operating system (OS) sits between hardware and application software, consisting of a kernel and system interfaces. The OS exclusively controls hardware resources, while apps interact via OS-provided APIs. Key functions include abstracting low-level hardware operations and managing orderly resource competition.
Multipro ...
Posted on Sat, 15 Aug 2026 16:19:34 +0000 by FourthChapter
Concurrency Utilities in Java: Callable, ReentrantLock, and Synchronized Explained
Returning Values from Threads with Callable
The Callable interfcae allows threads to return computation results and throw checked exceptions. Unlike Runnable, it features a call() method designed for task execution. To retreive the result, wrap the Callable instance in a FutureTask and pass it to a Thread.
import java.util.concurrent.Callable;
...
Posted on Thu, 13 Aug 2026 16:39:28 +0000 by eurozaf
Understanding Java Thread Pool Reuse Mechanisms
The Concept of Thread Reuse
In standard Java programming, when a task needs to be executed asynchronously, a developer typically creates a Thread object and passes a Runnable target to it. The execution is triggered by the native start0 method, which eventually calls the run() method of the Thread class. The standard implementation of Thread.ru ...
Posted on Sat, 08 Aug 2026 16:51:05 +0000 by gewthen
Building a Go Goroutine Pool: Concepts and Implementation for Efficient Concurrency
In concurrent programming, effectively managing computational resources is crucial for application performance and stability. Developers often leverage thread pools in languages like Java to control thread creation overhead, facilitate thread reuse, and optimize resource utilization. Similarly, in Go, while goroutines are designed to be lightwe ...
Posted on Sat, 08 Aug 2026 16:08:59 +0000 by Suchy
Implementing a Delayed Task Scheduler in Java
Java provides multiple mechanisms for executing a task after a certain delay. One robust modern approach is to use ScheduledExecutorService, which offfers better thread management and flexibility than the traditional Timer class. This article demonstrates how to schedule a one‑shot delayed task using this executor.
Overview: Scheduling a One‑Ti ...
Posted on Tue, 04 Aug 2026 17:01:08 +0000 by Adeus
Python Threading Fundamentals for Concurrent Programming
Core Threading Concepts
Threading represents the execution flow within a computational unit, serving as an abstract concept that defines the fundamental execution entity of a CPU. Understanding the distinction between processes and threads is crucial:
Processes functon as resource containers, holding all necessary runtime resources, while thre ...
Posted on Tue, 04 Aug 2026 16:29:25 +0000 by websesame