|
|
|
|
|
by seabrookmx
1005 days ago
|
|
JS doesn't have green threads, just a single threaded event loop and context switching via promises or async/await. Green threads implies parallelism implemented in user space (ala. GoLang goroutines or JVM virtual threads).. JS is not parallel only concurrent. |
|
Some environments support "M:N" greenthreading, mapping multiple userspace threads to multiple (but fewer) OS threads that are running in parallel, but that's not a required feature of greenthreading. In this case, the OS is still doing the parallelism.
And Python is not greenthreading because the concurrency comes from the OS, since each Py thread maps 1:1 to an OS thread.