CONCURRENCY / NOTES</>↗Concurrency11 May 2025
To implement a custom blocking queue in Java for special use cases, you can extend the AbstractQueue or directly implement the BlockingQueue<T> interface available in the java.util.concurrent package. A blocking queue is a data structure that supports thread-safe operations and blocks threads attempting to enqueue or dequeue elements when the queue is full or empty, […]
JSCH / NOTES</>↗JSch10 May 2025
Creating a reusable SSH connection pool using JSch in a multithreaded application involves managing connections efficiently and ensuring thread safety. JSch (Java Secure Channel) does not natively provide a connection pooling feature, so you have to implement it manually using a pooling library or write your own pooling logic. Below is the step-by-step guide to […]
CONCURRENCY / NOTES</>↗Concurrency10 May 2025
Building scalable parallel algorithms using ForkJoinTask in Java involves employing the Fork/Join framework, provided by the java.util.concurrent package. The Fork/Join framework is designed for recursive divide-and-conquer tasks that can be efficiently split into smaller subtasks that are processed in parallel. Here’s how you can approach building scalable parallel algorithms using ForkJoinTask: Steps to Build Scalable […]
SPRING CORE / NOTES</>↗Spring Core10 May 2025
In Spring, component scanning is a feature that allows the framework to detect and register Beans (annotated with @Component, @Service, @Repository, @Controller, or any custom stereotype annotations) automatically during application startup. Here’s how you can enable and use this feature effectively: 1. Enable Component Scanning in a Java Configuration Class To enable automatic scanning, use […]
CONCURRENCY / NOTES</>↗Concurrency10 May 2025
Fine-tuning thread pool behavior using ThreadPoolExecutor in Java is a powerful way to control thread execution and optimize performance according to your application’s needs. Here’s a detailed guide including key parameters and customization options: 1. ThreadPoolExecutor Overview The ThreadPoolExecutor class in the java.util.concurrent package provides a configurable thread pool implementation that lets you manage thread […]
KOTLIN / NOTES</>↗Kotlin09 May 2025
In Kotlin, lambdas and anonymous functions are fundamental features used for functional programming. They allow you to write concise and flexible code. Here’s an overview on how to use them: 1. Lambda Expressions A lambda is an anonymous function defined using curly braces {}. It’s a short way to declare a function without explicitly naming […]