Thread-Multiplexing for D

Sean Kelly sean at invisibleduck.org
Thu Sep 12 10:55:10 PDT 2013


On Sep 12, 2013, at 8:34 AM, Bienlein <jeti789 at web.de> wrote:

> About thread-multiplexing... You find a lot in Google when
> searching for socket multplexing, but not when searching for
> thread-multiplexing. Maybe I coined the term myself (don't know
> any more) when reading the section here:
> http://golang.org/doc/effective_go.html#goroutines
> 
> "Goroutines are multiplexed onto multiple OS threads so if one
> should block, such as while waiting for I/O, others continue to
> run. Their design hides many of the complexities of thread
> creation and management."

The trick in D is that because statics are thread-local by default, any multiplexed app like this that expects its static data to remain consistent across calls is likely to fail.  I've mentioned fiber-local storage here in the past, but it's a tricky problem.  But I think it's one that we will need to sort out for things like this to work as the user expects them to.


More information about the Digitalmars-d mailing list