How does D compare to Go when it comes to C interop?

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 10 21:25:52 PST 2015


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.


More information about the Digitalmars-d mailing list