Tag

FutureTask

0 views collected around this technical thread.

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
Architecture Digest
Architecture Digest
Jan 23, 2025 · Backend Development

Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java

This article explains how to improve backend performance by fetching independent report data concurrently using Java's Future, Callable, CompletableFuture, and FutureTask classes, provides code examples for each approach, and compares their principles, usage patterns, and cancellation capabilities.

BackendCallableCompletableFuture
0 likes · 9 min read
Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java
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
Selected Java Interview Questions
Selected Java Interview Questions
Aug 3, 2022 · Backend Development

Understanding Java Callable, Future, and FutureTask for Retrieving Thread Results

This article explains how to create threads using Runnable or Thread, introduces the Callable and Future interfaces introduced in Java SE 5.0, compares them, shows how to use ExecutorService methods, and demonstrates retrieving results with FutureTask and example code.

CallableExecutorServiceFuture
0 likes · 8 min read
Understanding Java Callable, Future, and FutureTask for Retrieving Thread Results
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.

ExceptionHandlingFutureTaskJava
0 likes · 5 min read
Understanding FutureTask: Features, Implementation, and Common Pitfalls
Cognitive Technology Team
Cognitive Technology Team
Jul 10, 2022 · Backend Development

Understanding ThreadPoolExecutor execute vs submit: Exception Handling, Pitfalls, and Best Practices

This article explains how ThreadPoolExecutor's execute and submit methods differ in exception handling, why execute may terminate a worker thread while submit silently swallows exceptions, and provides code examples and recommendations for proper error handling in Java concurrency.

ExceptionHandlingExecutorServiceFutureTask
0 likes · 6 min read
Understanding ThreadPoolExecutor execute vs submit: Exception Handling, Pitfalls, and Best Practices
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