www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - M:N thread multiplexing

reply Poyeyo <poyeyo arcadechaser.com> writes:
Reading this article: 
http://www.evanmiller.org/why-im-learning-perl-6.html
makes me curious about the state of Dlang's M:N thread 
multiplexing.

Quoting the article:
"if you want M:N thread multiplexing your options today are 
precisely Erlang, Go, .NET, and Perl 6."

Is it possible to add D to this list of languages mentioned in 
that article?
Jul 30 2017
next sibling parent Moritz Maxeiner <moritz ucworks.org> writes:
On Sunday, 30 July 2017 at 13:35:18 UTC, Poyeyo wrote:
 Reading this article: 
 http://www.evanmiller.org/why-im-learning-perl-6.html
 makes me curious about the state of Dlang's M:N thread 
 multiplexing.

 Quoting the article:
 "if you want M:N thread multiplexing your options today are 
 precisely Erlang, Go, .NET, and Perl 6."

 Is it possible to add D to this list of languages mentioned in 
 that article?
There is std.parallelism, which maps M tasks to N threads [1]. Not sure how it deals with blocking I/O, though. [1] https://dlang.org/phobos/std_parallelism.html
Jul 30 2017
prev sibling parent Bienlein <jeti789 web.de> writes:
On Sunday, 30 July 2017 at 13:35:18 UTC, Poyeyo wrote:
 Reading this article: 
 http://www.evanmiller.org/why-im-learning-perl-6.html
 makes me curious about the state of Dlang's M:N thread 
 multiplexing.

 Quoting the article:
 "if you want M:N thread multiplexing your options today are 
 precisely Erlang, Go, .NET, and Perl 6."

 Is it possible to add D to this list of languages mentioned in 
 that article?
Whenever I asked about CSP in D I got the answer to consider vibe.d. D has fibers. In addition to have something like green threads, it would need a mechanism that a fiber that is going to be blocked when taking from an empty channel is detached from that channel and assigned to one that is not empty. Not sure I agree that .NET has m:n threads in sense of CSP/green threads. About Perl 6 I don't know. Java has it as well through Quasar (http://docs.paralleluniverse.co/quasar/) and the JVM in general through Coroutines in Kotlin (https://kotlinlang.org/docs/reference/coroutines.html)
Jul 30 2017