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</>↗
Concurrency24 Dec 2025

How do I use ThreadLocal safely?

Using ThreadLocal safely is crucial because, while it provides a way to store data that is accessible only by a specific thread, it can easily lead to memory leaks and unexpected behavior in environments that use thread pools (like Spring MVC or Jakarta EE). Here is how to use it safely in your Java applications. […]

Wayan · 3 min read
CRYPTOGRAPHY / NOTES</>↗
Cryptography21 Dec 2025

How do I use Atomic variables from java.util.concurrent.atomic?

Atomic variables in java.util.concurrent.atomic are designed for lock-free, thread-safe operations on single variables. They leverage low-level CPU instructions like Compare-And-Swap (CAS) to ensure data consistency without the overhead of synchronized blocks. Here’s a guide on how to use the most common atomic classes. 1. AtomicInteger and AtomicLong These are used for numeric counters or IDs. […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency20 Dec 2025

How do I use ReentrantLock vs synchronized?

In Java, both synchronized and ReentrantLock are used to manage thread safety, but they offer different levels of control and flexibility. 1. synchronized Keyword The synchronized keyword is the built-in mechanism in Java for mutual exclusion. It is simpler to use because the JVM automatically handles acquiring and releasing the lock. Usage: Can be applied […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency19 Dec 2025

How do I use CountDownLatch for coordination?

A CountDownLatch is a synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes. It’s initialized with a given count, and the await() methods block until the current count reaches zero due to invocations of the countDown() method. Here is a practical guide on […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency19 Dec 2025

How do I use CyclicBarrier for synchronization?

In Java’s concurrency utilities, CyclicBarrier is a synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point. It is called “cyclic” because it can be re-used after the waiting threads are released. Here is a breakdown of how to use it effectively. 1. Basic Concepts […]

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

How do I use Semaphore for resource control?

Semaphore is an advanced synchronization mechanism used to control access to a shared resource by multiple threads. It can maintain a set of permits, restricting how many threads can concurrently access a critical section or shared resource. If the permits are exhausted, additional threads will block until permits are released. How to Use Semaphore for […]

Wayan · 3 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.