3 ms·
I routinely write programs that require a huge number of goroutines. Many programs in Go require a huge number of goroutines. Good thing modern kernels deal wit
by 4ad 10y ago
I routinely write programs that require a huge number of goroutines. Many programs in Go require a huge number of goroutines. Good thing modern kernels deal with large numbers of threads just fine. People misjudge how cheap kernel threads really are, because there was a time where they were expensive. That time was long ago. Today, threads are very light weight. For example, the solaris kernel schedules interrupts as threads, they are really that light weight.
There is a reason POSIX threading is implemented in the kernel on every operating system, even if they all started as N:M or 1:M implementations.
- asb 10y agoRelated to this discussion, this talk on user-scheduled OS threads is really interesting. It's a shame no proposed implementation or experimental patches have appeared https://www.youtube.com/watch?v=KXuZi9aeGTw https://www.youtube.com/watch?v=KXuZi9aeGTw
- imtringued 10y agoCan I start a thread and have it run code on a different core within one microsecond?
- paulddraper 10y agoIf you can, I hope you won't. What could you be hoping to accomplish?