gpt4 book ai didi

Java 线程,绿色还是原生?

转载 作者:行者123 更新时间:2023-11-29 03:47:31 25 4
gpt4 key购买 nike

如果我有多核机器,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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com