Answer the question
In order to leave comments, you need to log in
Does ExecuterService handle threads on multiple cores?
Hello! I'm new to Java, I'm currently reading a book and a question arose about multithreading:
The book says that different threads can run on different cores. As I understand it, everything that concerns, so to speak, the old thread model (Thread / ExecuterService) is always performed on the same core, and the new Fork / Join Framework API just allows you to separate threads by cores.
Is it so? Or can ordinary Threads also run on different cores?
Answer the question
In order to leave comments, you need to log in
see https://youtu.be/W82D9eUn6q8?list=LLmQvzzT2ZgTt1MZ...
perhaps it is difficult for a beginner, but interesting.
Regarding your question:
there were different approaches to building parallel computing (with different classes)
, they all gave approximately the same results (almost all)))
the result is that on an n-core processor, the calculation speed grows with the number of computation threads up to the number n. then stops.
This says that all implementations (thread classes, executors, etc.) use a lot of coreness. By the way, you can repeat these experiments yourself. It's pretty easy.
Of course it depends on the virtual machine (jvm), but I think almost all of them use multi-core.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question