OpenJDK JVM不会在多个核心上调度线程 [英] OpenJDK JVM does not schedule threads on multiple cores

查看:193
本文介绍了OpenJDK JVM不会在多个核心上调度线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在随Ubuntu 12.04一起分发的OpenJDK 6 JVM上运行我的多线程Java程序时,所有线程都安排在一个核心上。但是当我从Oracle最新的1.7 JDK在JVM上运行完全相同的程序时,它很好地围绕所有24个可用内核旋转了我的20个线程。 OpenJDK文档解释了Java线程将被分配给本机线程,但是它似乎没有工作。我的OpenJDK安装中是否有配置错误,或者它是否真的不支持多核硬件?

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:

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)


推荐答案

openjdk和oracles jdk之间应该没有区别,这些优质功能不会影响这样的线程。 Oracles JVM是基于它支持和增强的OpenJdk构建的,就像Redhat使用(现在)Wildfly版本增强Jboss一样。

there should be no difference between openjdk and oracles jdk outside of some premium features that wouldn't affect threading like this. Oracles JVM is built off the OpenJdk which they support and enhance, much the same way Redhat enhances Jboss with the (now) Wildfly versions.

这篇关于OpenJDK JVM不会在多个核心上调度线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆