Why are user-level threads in Java called "green"? [duplicate]
Asked Answered
U

3

6

Possible Duplicate:
Green Threads vs Non Green Threads

Why are Java threads implemented at the user level in the JVM called "green threads"? Is it by analogy to environmentalism, meaning to suggest that they are less wasteful than OS threads, or something else?

EDIT: Some references to where the term is used:

Undine answered 13/2, 2012 at 20:50 Comment(7)
@BrianRoach- I think the OP's question is why they're called "green," not what they are.Uttermost
Correct. I am asking why they are called green threads, not what they are. (See subject and first sentence.) If you let me know what about my phrasing was unclear, I'd be happy to edit my question, or one of you can yourself.Undine
@espertus- If this question does get closed, please let me know and I'll vote to reopen it. I think that people are misinterpreting what you're asking and thinking that this is a duplicate question.Uttermost
source for being called "green"? since i have not heard that (i.e. they are NOT called). if you mean why back in the day solaris threads were called green - cause the OS didn't support 'em and they were implemented in a cheaper (less resource consuming than process) way - hence green. But nomenclature has not been used for like 13 years now.Polycotyledon
@templatetypedef, who calls them "green"?Polycotyledon
@bestss- I'm not sure, actually! But I think that's beside the point, since if it's a term used in some communities or even historically then I'm interested to learn more.Uttermost
@templatetypedef, if you have some source, it's possible to track down the origin; i have not heard it since 1999 or so. Sun used to release java w/ 'green threads' and i'd imagine it's a leftover. It's possible to run grep on hotspot from openjdk for any reference in the comments. I know about the displaced object header but the green threads seems obsolete (to me)Polycotyledon
S
8

About green threads

This is just a name of the project (library) that was using this approach many years before

Seeker answered 13/2, 2012 at 20:54 Comment(2)
Any idea why that name was chosen?Undine
Of course no, I don't even know why does my projects name mean sometimes, just a nameSeeker
C
4

Green has many possible meanings, if it is using a generally accepted meaning. For me it made sense to call it "green" to mean

Youthful; vigorous: at the green age of 18.

Not mature or ripe; young: green tomatoes.

Brand-new; fresh.

Lacking sophistication or worldly experience; naive.

http://www.thefreedictionary.com/Green

Container answered 13/2, 2012 at 21:1 Comment(4)
Thanks for taking my question seriously. That hasn't been a problem with my prior SO questions, including ones about naming, but somehow this one rubbed people the wrong way.Undine
Sometimes apparently naive questions have interesting answers, which many only occur to you many years later. There are no stupid questions, but I do get annoyed by repetitive ones.Container
Thanks, although I don't think this question is naive. I'm a professor preparing a lecture on threads and suspect my students will be curious as to why green threads are called that. I'm lucky enough to have curious students and want to be able to answer their questions.Undine
I don't think its naive either. But often, off topic questions can appear so.Container
U
1

A friend provided me with the historical answer: the "green" apparently comes from the Green Team, the original code name of the Java project.

Undine answered 14/2, 2012 at 17:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.