3 ms·
If your event loop is as slow as 1000+ coroutines or OS threads, you are doing it very very wrong.
by zzzcpan 9y ago
If your event loop is as slow as 1000+ coroutines or OS threads, you are doing it very very wrong.
- jashmatthews 9y agoAFAIK the main benefit to coroutines is getting to manually manage tiny stacks. For example, in Go, they mark a goroutine's stack as "hasn't executed since the last time we marked", which makes GC with thousands of threads a lot faster.
- arghwhat 9y ago[Citation needed]
- jashmatthews 9y agohttps://github.com/golang/go/issues/12061 https://github.com/golang/go/issues/12061 "Mark termination does not have to rescan stacks that haven’t executed since the last scan" With pre-emptive scheduling of OS threads, you potentially dirty a ton more stacks, and have to scan them all for pointers to heap memory. I'm not sure how VMs using lots of OS threads deal with this.