问题
When I run my multi-threaded Java program on the OpenJDK 6 JVM that is distributed with Ubuntu 12.04, all threads are scheduled on a single core. But when I run the exact same program on the JVM from Oracle's latest 1.7 JDK, it nicely rotates my 20 threads around all 24 available cores. The OpenJDK documentation explains that Java threads will be assigned to native threads, but it doesn't seem to be working. Could there be something configured wrong in my OpenJDK installation, or does it not really support multicore hardware?
OpenJDK:
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Oracle JDK:
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
来源:https://stackoverflow.com/questions/19072133/openjdk-jvm-does-not-schedule-threads-on-multiple-cores