[m-dev.] for review - new stuff for the extras directory.
Ralph Becket
rbeck at microsoft.com
Tue Feb 29 20:59:56 AEDT 2000
> From: Thomas Conway [mailto:conway at cs.mu.OZ.AU]
>
> 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
>
> So what this library is providing is just concurrency. Parallelism is
> possible - if you compile in the grade asm_fast.gc.par, then you can
> start up multiple engines, and get both parallelism and concurrency.
>
> If you read the comment above the declaration for spawn/3, you'll
> notice that its semantics only mention the interleaving of IO
> operations. This means that it is unspecified whether in operational
> terms, execution is parallel or interleaved-sequential.
In a coroutining model there is only ever one thread active at any
time and context switches only occur when the running thread yields or
blocks. In a pre-emptive model, a context switch can occur at any time.
Now, there isn't a great deal of difference as far as the programmer is
concerned in a pure, declarative language, *except* where impure code
is used or if we introduce asynchronous exceptions into the language (e.g.
thread A throws an exception into thread B).
Okay, the mode for spawn//1 doesn't include the facility for impure
goals, however that doesn't mean that a goal can't use a promise_pure
library with an impure implementation - in which case it may well be
important to know which concurrency model one is running under.
If it really doesn't matter which model is in use, I'd rather
s/corouting/thread/ in the yield//0 docs.
Cheers,
Ralph
--------------------------------------------------------------------------
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