2 ms·
The main difference between a green and a non-green thread is that the scheduling of said thread is done in userspace. Also, JVM threads are not green since the
by eptcyka 8y ago
The main difference between a green and a non-green thread is that the scheduling of said thread is done in userspace. Also, JVM threads are not green since the early 2000s, there's a 1:1 mapping between Java threads and actual kernel threads, and as far as I'm aware, said java threads are never migrated between different kernel threads.
- slikts 8y agoYou're right, I qualified it with "classic JVM threads", but a less ancient example would be better; it's just not immediately clear which green thread implementations are also relatively heavyweight like JVM green threads used to be.
- eptcyka 8y agoI believe the distinction between heavyweight and green threads here is not really the correct comparison. It's more of a comparison between kernel managed (non-green) threads and userspace managed (green) threads. One could argue that Goroutines are green threads that are executed on non-green threads. It's also not infeasible to imagine a system where kernel threads are actually lightweight - single address-space unikernels come to mind.
- slikts 8y agoI'll rework that section; thanks for the feedback.