Can the JVM abstract multi-cores CPU?
Garbage collection in Java has helped programmers not worry with pointers and memory management. Now, hardware has turned to multi-cores CPU and I'm interested in learning how the JVM can abstract the CPU power for the programmer. Any web site or research paper would be of interest to me.
Don't answer me that Java has already provided all the programming tools for the next generation of 8+ cores CPU with threads and java.util.concurrent and RTFJ (RTF Javadoc!) and please read the rest of that post.
Here is an example of what I would like the JVM to automatically achieve or let a programmer do without too much efforts and a library. But just like the JVM hid all the memory management processing from the programmer, I think the JVM should do it too with CPU and hide the complexity of multi-core programming.
Let's say I want to code a task which is CPU intensive and which could be easily parallelized with a divide and conquer algorithm, like quicksort. I could decide to split the task between two threads and let the JVM distribute a thread on each core. Recursively, each threads could decide also to split their job between two other threads. At some time, the number of threads will be more than the number of cores available to process them and the performance will degrade. So how can the programmer decide when to use concurrency and threads to balance the load to another processing unit? And when not to do so!
Perhaps java.lang.management could be a base for developing a library to balance the load between multiple cores or CPU. If we know the number of CPU available and the current load of the system, we could define a heuristic to decide to create a new thread when there is some CPU power available and let the JVM use it.
But the JVM has a better view of the system it abstracts for the programmer. So I think it should provide a hook to let him know that some CPU power is available and can be used by the programmer. Like for the GC, different strategies could be set (-XX:...).
What do you think? Can you give me pointers to works in that area?