SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CONCURRENCY / NOTES</>↗
Concurrency23 Nov 2025

How do I use ForkJoinPool for recursive tasks?

ForkJoinPool in Java is a part of the java.util.concurrent package and is designed to efficiently execute recursive tasks using a work-stealing algorithm. It works particularly well for problems that can be split into smaller subproblems and then combined to form the final result, adhering to the divide-and-conquer paradigm. Here’s how you can use ForkJoinPool for […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency22 Nov 2025

How do I schedule tasks using ScheduledExecutorService?

To schedule tasks using ScheduledExecutorService in Java, follow these steps: 1. Create a ScheduledExecutorService Use Executors.newScheduledThreadPool(int corePoolSize) to get an instance of ScheduledExecutorService. corePoolSize: Number of threads to keep in the pool. 2. Schedule Tasks The ScheduledExecutorService provides three methods for scheduling tasks: schedule: Schedule a task to run after a specific delay. scheduler.schedule(() -> […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency16 Nov 2025

How do I use ExecutorService with virtual threads?

To use ExecutorService with virtual threads in Java, you can leverage the Executors.newVirtualThreadPerTaskExecutor() method. This method creates an ExecutorService where each task is executed on a new virtual thread, managed by the Java runtime. Here’s a step-by-step guide: 1. Dependencies & Setup Ensure you are using Java 19 or newer. Virtual threads were introduced as […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency14 Nov 2025

How do I combine multiple CompletableFutures?

To combine multiple CompletableFuture objects in Java, you can use the following approaches, depending on your specific use case: 1. Combine Two Futures If you have two CompletableFuture instances and need to combine their results, use the thenCombine method. It lets you specify how to merge the results of both futures. Example: CompletableFuture<String> future1 = […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency12 Nov 2025

How do I use CompletableFuture for async tasks?

CompletableFuture is a powerful tool in Java to implement asynchronous programming. It allows you to perform tasks in the background, chain multiple async tasks together, handle both success and failure scenarios, and combine multiple async computations. Here’s a summary of how to use CompletableFuture with examples: 1. Run a task asynchronously Use supplyAsync() (if the […]

Wayan · 4 min read
LANG PACKAGE / NOTES</>↗
Lang Package12 Nov 2025

How do I use the Virtual Threads API Project Loom?

The Virtual Threads API is part of Project Loom in the Java platform. With Java 19, virtual threads became available as a preview feature, enabling the creation of lightweight threads that can run concurrently. They work similarly to traditional threads but are much cheaper in terms of memory and thread management because they are managed […]

Wayan · 4 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.