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

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

问题描述

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

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.

任何预期的行为问题。

Any expected behaviour problems.

推荐答案

维基百科文章绿色线程解释得非常好。

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的上下文中,绿色线程已成为过去。请参阅本文。 (这是关于Solaris的,但绿色线程不再使用的事实对于通常的平台是有效的。)

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

绿色线程在Sun JVM for Linux中被放弃了版本1.3的发布(参见 Java [tm]在archive.org上的Linux平台技术。这可以追溯到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天全站免登陆