Tagged articles
16 articles
Page 1 of 1
macrozheng
macrozheng
Feb 6, 2025 · Backend Development

Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained

This article explores four Java asynchronous programming approaches—Future with Callable, CompletableFuture, and FutureTask—detailing their principles, usage patterns, code examples, and how to retrieve results from thread pools, helping developers improve performance for tasks like aggregating order and fee summaries.

CallableCompletableFutureFuture
0 likes · 12 min read
Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained
Java Web Project
Java Web Project
Feb 1, 2025 · Backend Development

Choosing the Right Java Async Tool: Future, CompletableFuture, or FutureTask

This article compares three Java concurrency approaches—Future with Callable, CompletableFuture, and FutureTask—explaining their underlying principles, step‑by‑step usage, code examples, and trade‑offs so you can decide which asynchronous tool best fits your reporting workload.

CompletableFutureFutureFutureTask
0 likes · 10 min read
Choosing the Right Java Async Tool: Future, CompletableFuture, or FutureTask
Selected Java Interview Questions
Selected Java Interview Questions
Nov 11, 2024 · Backend Development

Understanding the Difference Between execute() and submit() in Java ThreadPoolExecutor

This article explains how Java's ThreadPoolExecutor handles tasks submitted via execute() and submit(), why execute() prints exceptions directly while submit() defers them until Future.get() is called, and provides detailed source‑code analysis and examples to illustrate the underlying mechanisms.

FutureTaskJavaThreadPoolExecutor
0 likes · 14 min read
Understanding the Difference Between execute() and submit() in Java ThreadPoolExecutor
Su San Talks Tech
Su San Talks Tech
Feb 11, 2024 · Backend Development

How to Retrieve Async Return Values with Java FutureTask?

This article explains how to obtain return values from asynchronous Java methods using FutureTask, covering its AQS foundation, execution flow, get() behavior, and provides concrete source code examples for practical implementation.

AQSAsyncFuture
0 likes · 13 min read
How to Retrieve Async Return Values with Java FutureTask?
Cognitive Technology Team
Cognitive Technology Team
Jul 23, 2022 · Backend Development

Understanding FutureTask: Features, Implementation, and Common Pitfalls

FutureTask acts as a proxy for asynchronous tasks in Java, providing result retrieval with optional timeout, completion checks, cancellation, and repeat execution, while managing task state, outcomes, and exceptions; the article illustrates usage, internal fields, and common pitfalls such as missed exceptions and indefinite blocking.

AsynchronousFutureTaskJava
0 likes · 5 min read
Understanding FutureTask: Features, Implementation, and Common Pitfalls
Selected Java Interview Questions
Selected Java Interview Questions
Apr 23, 2022 · Backend Development

Understanding ThreadPoolExecutor in Java: States, Constructors, Parameters, and Usage

This article provides a comprehensive guide to Java's ThreadPoolExecutor, covering its lifecycle states, constructor arguments, work‑queue options, keep‑alive behavior, thread factories, rejection policies, common methods, and practical code examples for Callable, Runnable, Future and FutureTask.

CallableExecutorServiceFuture
0 likes · 20 min read
Understanding ThreadPoolExecutor in Java: States, Constructors, Parameters, and Usage
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 6, 2020 · Backend Development

Analyzing JDK 1.8 FutureTask Source Code

This article provides a detailed analysis of JDK 1.8’s FutureTask implementation, explaining its purpose, usage examples, internal structure, state transitions, key methods such as run, get, cancel, and the concurrency mechanisms like volatile fields, CAS operations, and thread‑waiting queues.

CallableFutureFutureTask
0 likes · 32 min read
Analyzing JDK 1.8 FutureTask Source Code
Selected Java Interview Questions
Selected Java Interview Questions
May 18, 2020 · Backend Development

Understanding Java's java.util.concurrent (J.U.C) Framework and AQS Mechanism

This article provides a comprehensive overview of Java's java.util.concurrent package, detailing its core components such as atomic classes, locks, collections, executors, tools, as well as an in‑depth explanation of the AbstractQueuedSynchronizer (AQS) framework, its fields, methods, and related concurrency utilities like FutureTask, BlockingQueue, ForkJoin, and work‑stealing algorithms.

AQSForkJoinFutureTask
0 likes · 22 min read
Understanding Java's java.util.concurrent (J.U.C) Framework and AQS Mechanism
Programmer DD
Programmer DD
Jan 10, 2020 · Backend Development

Unlocking Java’s FutureTask: A Deep Dive into Asynchronous Programming

This article explains how to use JDK’s Future and FutureTask for asynchronous computation, walks through their APIs, internal state machine, core methods like run(), get(), cancel(), and highlights their limitations while introducing CompletableFuture as a more powerful alternative.

AsynchronousCompletableFutureFutureTask
0 likes · 25 min read
Unlocking Java’s FutureTask: A Deep Dive into Asynchronous Programming