On Fri, 11 Dec 2015 01:43:12 +0000, deadalnix wrote: > Benchmark needed. It not like the stack is randomly accessed, so I don't > think the TLB argument makes a lot of sense.
The TLB issue is about the pattern of memory access, and that's got a lot more to do with the user's code than with the stack arrangement. So it's a red herring. > I mean, yes, if you run tens of thousand of fibers maybe you'll > experience that, but that doesn't sound like a very smart plan to boot. I have a use case for hundreds of thousands of fibers, but that's accompanied with a custom scheduler. I expect most of them will only need to be called about once per minute. Incidentally, implementing a custom scheduler was pretty essential for this project, as was canceling coroutines. Go doesn't allow for either. I also wanted to be able to list coroutines and store a piece of data on each, or at least to get a reference to the current coroutine so I could store it somewhere and determine if anything that should have a running coroutine didn't have one. None of this was possible in Go.