www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Go: A new system programing language

reply Sean Kelly <sean invisibleduck.org> writes:
Bill Baxter Wrote:
 
 Is it possible to do the kind of "goroutine" scheduling they do purely
 as a library?

I think so. It sounds like they basically just have a thread pool that executes fibers, and D 2.0 already has fibers.
 That wasn't really clear to me how their "segmented stacks" thing
 works.  Sounds like it would need low-level runtime system support,
 though.

In the description, it sounds like they're just talking about the stacks resizing on demand. Maybe the "segmented" bit comes from the stack not being contiguous in memory, but that sounds a bit weird. Either way, the underpinnings are already in place in D's fibers for auto stack growth (thanks to Mikola Lysenko), so I don't see this as a compiler-dependent feature or anything like that.
Nov 11 2009
parent reply Bill Baxter <wbaxter gmail.com> writes:
On Wed, Nov 11, 2009 at 9:00 PM, Sean Kelly <sean invisibleduck.org> wrote:
 Bill Baxter Wrote:
 Is it possible to do the kind of "goroutine" scheduling they do purely
 as a library?

I think so. =A0It sounds like they basically just have a thread pool that=

 That wasn't really clear to me how their "segmented stacks" thing
 works. =A0Sounds like it would need low-level runtime system support,
 though.

In the description, it sounds like they're just talking about the stacks =

eing contiguous in memory, but that sounds a bit weird. =A0Either way, the = underpinnings are already in place in D's fibers for auto stack growth (tha= nks to Mikola Lysenko), so I don't see this as a compiler-dependent feature= or anything like that.

So fibers are there today in D2? I didn't realize that bit of Tango's runtime was now rolled in. Cool! Are they documented anywhere? Looks like docs for all of core are not yet being shown on digitalmars.com. --bb
Nov 12 2009
parent Mike Parker <aldacron gmail.com> writes:
Bill Baxter wrote:
 On Wed, Nov 11, 2009 at 9:00 PM, Sean Kelly <sean invisibleduck.org> wrote:
 Bill Baxter Wrote:
 Is it possible to do the kind of "goroutine" scheduling they do purely
 as a library?

 That wasn't really clear to me how their "segmented stacks" thing
 works.  Sounds like it would need low-level runtime system support,
 though.


So fibers are there today in D2? I didn't realize that bit of Tango's runtime was now rolled in. Cool! Are they documented anywhere? Looks like docs for all of core are not yet being shown on digitalmars.com. --bb

Try here: http://www.dsource.org/projects/druntime/browser/trunk/src/common/core/thread.d#L2640
Nov 12 2009