fibers/coroutines tutorial?

Russel Winder russel at winder.org.uk
Fri Jan 24 11:51:07 PST 2014


On Fri, 2014-01-24 at 16:02 +0000, Hasan wrote:
> Is there a quick tutorial/intro for what D offers as an 
> equivalent or alternative to "goroutines"?
> 
> I've seen the concurrency link on the homepage .. and umm .. call 
> me lazy but I don't feel like reading through all that just to 
> see what D's alternative to goroutines looks like ..

Now that is just bad research ;-)

As far as I am aware D has no equivalent of Go's goroutines per se.  A
goroutine is (well should be) a process with no access to any global
shared memory, with channels with which to communicate to other
goroutines. Effectively Go realizes Communicating Sequential Processes
(CSP), not 1978 style, but about 2009 style. D's built-in
concurrency/parallelism supports is much more akin to actors.

D would be improved by having a realization of CSP to augment what it
already has. For now though you would have to build a CSP-style system
over the actor-style system, though this would have inefficiencies. The
problem will be how to realize the select operation.

For now the only realizations of CSP that I am aware of that are usable
are Go, PyCSP, PythonCSP, JCSP, GroovyCSP, C++CSP2.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d-learn mailing list