Nexus's honest review, Kim Young-han's Practical Java - Advanced, Part 1: Multithreading and Concurrency course
Reviews 8
Average rating 5
This lecture was a legendary class where the characteristics of multithreading content perfectly matched Kim Young-han's unique approach of "explaining fundamental principles and reasons in an easy-to-understand way," allowing me to properly understand concepts that might not be intuitively grasped when studying from other books. Thanks to this, I was able to understand difficult concepts really easily. Additionally, if I may dare to mention some curious points or things I thought "would have been even better," I think it would have been great if an explanation of how "threads" in Java differ from what "threads" mean when we choose CPUs had been added to the beginning. I also love games like Young-han and have a lot of interest in hardware, so initially I was a bit confused thinking threads were the same as in "hyper-threading" or "8-core 16-thread" πππ I think many other students who love computers probably experienced similar confusion. And I have another additional question. I remember you saying that to solve memory visibility problems that occur because each CPU core has separate cache allocated to it, we use the volatile keyword, and when volatile is attached, variable values are stored in main memory rather than cache, which makes value lookup slower. However, while L1 and L2 caches exist independently for each core, L3 cache is shared by all cores, so storing values in L3 cache instead of main memory could solve memory visibility problems while minimizing the speed degradation of reading values - so I'm curious why values are stored in main memory. I asked ChatGPT but I lack the knowledge to understand GPT's answer ππππππ If you have time, I would be grateful if you could briefly explain this in a reply!!
1
Hello. Thank you, Nexus, for listening attentively and providing feedback :) As you thought, volatile variables do indeed use cache in practice and perform as many internal optimizations as possible. The most important core aspect of volatile is that it 'guarantees all threads always read the same value.' Diving deep into the complex internal workings of hardware (such as cache coherence protocols) is not the key to understanding the main purpose of this keyword. Therefore, when explaining this content from a thread perspective, we simplify by saying "reads and writes directly from main memory" to convey the core concept of 'guaranteeing values are immediately visible to all threads (visibility).' Thank you.
1

