3 ms·
More information: https://en.wikipedia.org/wiki/Green_threads https://en.wikipedia.org/wiki/Green_threads Which makes me wonder how this is new: > In Java 1.
by msla 5y ago
More information:
https://en.wikipedia.org/wiki/Green_threads https://en.wikipedia.org/wiki/Green_threads
Which makes me wonder how this is new:
> In Java 1.1, green threads were the only threading model used by the Java virtual machine (JVM),[8] at least on Solaris. As green threads have some limitations compared to native threads, subsequent Java versions dropped them in favor of native threads.[9][10]
So is the "new" part that green threads are coming back to Java?
- jmgao 5y agoThe "some limitations" there was mostly that original green threads implementation in Java lived on a single OS thread, so you could only use one core. Presumably that's changing this time around?
- Twisol 5y agoYes, by my reading of the linked JEP, these virtual threads are executed by a pool of honest-to-goodness OS threads (so a virtual thread might pause on one thread and get resumed on another).
- Const-me 5y ago> at least on Solaris On Windows NT as well. On my first job around 2000 I did a little bit of Java programming. As far as I recall, JVM scheduled all their threads on top of a single OS thread.
- hashmash 5y agoWindows NT natively supported threads when Java was released, and Java on Windows NT (and Windows 95) in 1996 used OS threads. There were some problems when running on machines with more than one CPU, but I never figured out if this was the the fault of the OS or the JVM.