Tuanh.nettuanhnet.hashnode.dev·Dec 5, 2024Techniques for Handling ABA Problems in CAS with JavaSource: Techniques for Handling ABA Problems in CAS with Java 1. Understanding CAS and the ABA Problem 1.1 What is CAS (Compare-And-Swap)? Compare-And-Swap (CAS) is a fundamental atomic operation used in concurrent programming to ac...DiscussJava
Tuanh.nettuanhnet.hashnode.dev·Nov 7, 2024How Do Java Thread Locals Work? Uncovering the Secrets Behind Safe Thread-Local VariablesSource: How Do Java Thread Locals Work? Uncovering the Secrets Behind Safe Thread-Local Variables 1. Understanding Java ThreadLocals Java ThreadLocal is a special type of variable that provides each thread that accesses it with its own, ...Discussthread
Tuanh.nettuanhnet.hashnode.dev·Oct 31, 2024Techniques for Managing Concurrency in Java Using SemaphoresSource: Techniques for Managing Concurrency in Java Using Semaphores 1. What is a Semaphore in Java? A semaphore in Java is a synchronization aid that restricts the number of threads that can access a shared resource at any given time. I...Discussthread
Tuanh.nettuanhnet.hashnode.dev·Oct 7, 2024What Is CyclicBarrier? Key Facts and Examples ExplainedSource: What Is CyclicBarrier? Key Facts and Examples Explained 1. What Is a CyclicBarrier? A CyclicBarrier is a synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point. Once all threads reac...DiscussJava
Tuanh.nettuanhnet.hashnode.dev·Oct 5, 2024Which Class Do the wait(), notify(), and notifyAll() Methods Belong To?Source: Which Class Do the wait(), notify(), and notifyAll() Methods Belong To? 1. Understanding the wait(), notify(), and notifyAll() Methods The wait(), notify(), and notifyAll() methods are integral to Java's concurrency model. They belong ...Discussthread
Tuanh.nettuanhnet.hashnode.dev·Oct 3, 2024What is a Race Condition? Causes, Examples, and SolutionsSource: What is a Race Condition? Causes, Examples, and Solutions 1. Understanding Race Conditions A race condition occurs when two or more threads or processes access shared resources concurrently, and the final outcome depends on the timing ...Discussthread
Tuanh.nettuanhnet.hashnode.dev·Sep 22, 2024Java Thread Pool: How to Efficiently Manage ThreadsSource: Java Thread Pool: How to Efficiently Manage Threads 1. Introduction to Thread Pool in Java 1.1 What is a Thread Pool? A thread pool is a group of pre-instantiated reusable threads that are available to perform tasks. When a task i...DiscussJava
Tuanh.nettuanhnet.hashnode.dev·Sep 18, 2024Why Singleton Bean Scope Can Handle Multiple Parallel Requests And Key ConsiderationsSource: Why Singleton Bean Scope Can Handle Multiple Parallel Requests And Key Considerations 1. Understanding Singleton Scope in Spring The singleton scope in Spring ensures that only one instance of a bean is created and shared across the en...DiscussSpring
Tuanh.nettuanhnet.hashnode.dev·Sep 8, 2024Handling Multithreading in Java with Completable FutureSource: Handling Multithreading in Java with Completable Future 1. Understanding Completable Future CompletableFuture is part of the java.util.concurrent package and offers a way to write asynchronous, non-blocking code in a more readable and ma...DiscussJava
Tuanh.nettuanhnet.hashnode.dev·Aug 31, 2024What You Need to Know About Virtual Threads in JavaSource: What You Need to Know About Virtual Threads in Java 1. Introduction to Virtual Threads Virtual threads are a lightweight concurrency abstraction introduced in Java to address the challenges of managing a large number of threads efficie...DiscussJava