绿线与非绿线 [英] Green Threads vs Non Green Threads

查看:29
本文介绍了绿线与非绿线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解这些类型的线程提供的优势.

I'd like to understand the advantages provided by these type of threads.

  • 绿色线程在哪些环境中比非绿色线程更好?有人说绿色线程更适合多核处理器.

  • In what environments are green threads better than non-green? Some say green threads are better for multi core processors.

任何预期的行为问题.

推荐答案

维基百科文章 Green Threads 解释得很好.

The Wikipedia article Green Threads explains it very well.

绿色线程是用户级线程".它们由普通"用户级进程调度,而不是由内核调度.因此,它们可用于在不提供该功能的平台上模拟多线程.

Green threads are "user-level threads". They are scheduled by an "ordinary" user-level process, not by the kernel. So they can be used to simulate multi-threading on platforms that don't provide that capability.

特别是在 Java 上下文中,绿色线程已成为过去.请参阅文章JDK 1.1 for Solaris 开发人员指南.(这是关于 Solaris,但不再使用绿色线程这一事实适用于通常的平台).

In the context of Java specifically, green threads are a thing of the past. See article JDK 1.1 for Solaris Developer's Guide. (It's about Solaris, but the fact that green threads are not used anymore is valid for the usual platforms).

从 1.3 版开始,Sun JVM for Linux 中放弃了绿色线程(参见 Linux 平台上的 Java[tm] 技术(archive.org 上).这可以追溯到 2000 年.对于 Solaris,JDK 1.2 提供了本机线程.那可以追溯到 1998 年.我什至不认为 Windows 有绿色线程实现,但我找不到相关参考.

Green threads were abandoned in the Sun JVM for Linux as of the release of version 1.3 (see Java[tm] Technology on the Linux Platform on archive.org). That dates back to 2000. For Solaris, native threads were available from JDK 1.2. That dates back to 1998. I don't even think there ever was a green thread implementation for Windows, but I can't find a reference for that.

维基百科文章中有一些例外情况,我收集的主要是低功耗(嵌入式)设备.

There are some exceptions as noted in the Wikipedia article, I gather mostly for low-power (embedded) devices.

这篇关于绿线与非绿线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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