Java 线程,绿色还是原生?

标签 java multithreading

如果我有多核机器,Java 线程是否运行在不同的处理器内核上?换句话说,如果我运行 Thread.start(),这个线程是绿色的还是原生的?

谢谢

最佳答案

In Java 1.1, green threads were the only threading model used by the JVM, at least on Solaris. As green threads have some limitations compared to native threads, subsequent Java versions dropped them in favor of native threads.

An exception to this is the Squawk virtual machine, which is a mixture between an operating system for low-power devices and a Java virtual machine. It uses green threads in order to keep the native code to an absolute minimum and to support the migration of its isolates.

所以说Wikipedia .

关于Java 线程,绿色还是原生?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10258474/

相关文章:

Java zk层次结构获取数据库

java - 将这些口头规则转化为条件

c - 在循环内动态分配结构

java - 仅在窗口在 Java 中不再可见后才读取值

c# - 从计时器线程调用 System.Timers.Timer.Stop

java - 线程等待另一个线程

java - Java 新手,请帮助我的程序运行!我的任务是编写一个将整数转换为罗马数字的程序

java - Ubuntu Java-jar 错误 : Could not find or load main class

java - Jersey 在序列化期间省略 XmlTransient 注释

linux - 在GDB中调试多线程程序时如何一次继续一个线程?