Author Archives: Stanislav_Panteleev

Java.Multithreading. if i use ForkJoin is it guaranteed to solve each task on different core ?

❌ No, not guaranteed, but ✅ it is highly optimized and designed to do so — more than ThreadPoolExecutor. Let’s break this down 👇

Posted in Без рубрики | Comments Off on Java.Multithreading. if i use ForkJoin is it guaranteed to solve each task on different core ?

Java.Multithreading.If i use ThreadPoolExecutor, may it be possible that tasks will be executed on different cores ?

yes, if you use a ThreadPoolExecutor, it is possible and very likely that your tasks will be executed on different CPU cores, depending on how many threads your executor runs and how many cores are available. Let’s break it down … Continue reading →

Posted in Без рубрики | Comments Off on Java.Multithreading.If i use ThreadPoolExecutor, may it be possible that tasks will be executed on different cores ?

Java.Multithreading.What is the difference between “concurrency” and “parallelism”?

🧠 Quick Definition: Term Definition Concurrency Dealing with lots of tasks at once (not necessarily simultaneously) Parallelism Actually doing lots of tasks at the same time

Posted in Без рубрики | Comments Off on Java.Multithreading.What is the difference between “concurrency” and “parallelism”?

Java.Multithreading.What is “thread safety”?

🔐 What Is Thread Safety? Thread safety means: A piece of code or a data structure behaves correctly when accessed by multiple threads at the same time, without causing: data corruption, race conditions, unexpected behavior. In simple terms: It works … Continue reading →

Posted in Без рубрики | Comments Off on Java.Multithreading.What is “thread safety”?

Java.Multithreading.HappensBeforeExample

Posted in Без рубрики | Comments Off on Java.Multithreading.HappensBeforeExample

Java.Multithreading.What is main main memory, is it heap ?

🧠 What is “Main Memory” in the Java Memory Model? In the context of the Java Memory Model (JMM), main memory refers to the shared memory area where all variables (especially instance fields, static fields, and array elements) reside and … Continue reading →

Posted in Без рубрики | Comments Off on Java.Multithreading.What is main main memory, is it heap ?

Java.Multithreading.Explain the Java memory model?

The Java Memory Model (JMM) defines how threads interact through memory — specifically, how changes to variables made by one thread become visible to others. It’s part of the Java Language Specification and is enforced by the Java Virtual Machine … Continue reading →

Posted in Без рубрики | Comments Off on Java.Multithreading.Explain the Java memory model?

Java.Serialization.JSON.XML

🚀 While Java’s built-in binary serialization (Serializable) is powerful, you often want to serialize objects to readable and interoperable formats like JSON, XML, or YAML, especially for: APIs Config files Cross-platform communication (e.g., Java ↔ Python) Let’s walk through the … Continue reading →

Posted in Без рубрики | Comments Off on Java.Serialization.JSON.XML

Java.Serialization.What are the ways to control the values ​​of the deserialized object

🔧 1. Use a Custom readObject() Method This is the standard way to hook into deserialization:

Posted in Без рубрики | Comments Off on Java.Serialization.What are the ways to control the values ​​of the deserialized object

Java.Serialization.What is the problem with Singleton serialization?

🧠 What’s a Singleton? A Singleton ensures that a class has only one instance in the JVM: ✅ So when you do:

Posted in Без рубрики | Comments Off on Java.Serialization.What is the problem with Singleton serialization?