2 ms·
It's just green threading, which has been around for a long time. You can run millions of threads on a single machine with modern Linux kernels if you either h
by zigzigzag 10y ago
It's just green threading, which has been around for a long time.
You can run millions of threads on a single machine with modern Linux kernels if you either have lots of memory or simply minimize your stack sizes and usage. The kernel doesn't care much. You don't really need any special language features. The main reason fibers/green threads/goroutines/etc have become popular lately is that common language runtimes and standard libraries don't resize thread stacks on the fly and tend to like very deep call stacks, so minimising your memory usage can be rather hard.
- soulbadguy 10y ago> he main reason fibers/green threads/goroutines/etc have become popular lately is that common language runtimes and standard libraries don't resize thread stacks on the fly and tend to like very deep call stacks, so minimising your memory usage can be rather hard. Green-thread, coroutine have been around for a long time, the recent popular is probably due to increase prevalence of people trying to solve the C10K problem. Green thread, are more efficient both in term of memory consumption and context switching than kernel thread (even more so with compiler support). The linux kernel might be able to handle millions of threads, but thruth is one can do it much more efficiently in userland