[m-dev.] for review - new stuff for the extras directory.

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 29 20:30:12 AEDT 2000


On 29-Feb-2000, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> On Mon, Feb 28, 2000 at 11:05:26PM EST, Ralph Becket wrote:
> > This is great stuff!  I've been looking forward to the arrival of
> > coroutining/concurrency for a while.
> > 
> > > extrax/concurrency/spawn.m:
> > 
> > At first glance it looks like spawn//1 and yield//0 are independent
> > of whether or not the underlying concurrency model is coroutining
> > or pre-emptive, but the documentation for yield//0 explicitly
> > states that it hands over to another *coroutine*.  If this isn't a
> > bug and the library does assume coroutining then this should be
> > mentioned in the module header documentation and the docs for spawn//1.
> 
> The terminology I use to make things clear is:
> 
> parallelism	- using multiple CPUs, doing things *at*the*same*time*
> 
> concurrency	- giving a model to the programmer that includes the
> 		  *concept* of multiple things happening at once

Coroutining is something different again.
With coroutining, you have the concept of multiple different
call stacks, but there is no concurrency.  There are multiple things
happening, but not at the same time, instead they take it in turns.
Coroutining is, if you like, a special case of concurrency where you know that
there is exactly one engine, so you don't get any nondeterminism in the
results, as you would normally get with concurrency.

Therefore the use of the term "coroutine" in the documentation
is somewhat misleading.  I suggest you use something like "Mercury thread" instead.
This would avoid the misleading implication (coroutine => not concurrent).


-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list