[plt-scheme] Threads and evaluation model

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Sep 10 08:13:11 EDT 2008

At Wed, 10 Sep 2008 05:06:23 -0700, "Greg Woodhouse" wrote:
> I have a question about section 1.1.13 of the Reference:
> 
> 1.1.13 Threads
> Scheme supports multiple, pre-emptive threads of evaluation. In terms of the
> evaluation model, this means that each step in evaluation actually consists
> of multiple concurrent expressions, rather than a single expression. The
> expressions all share the same objects and top-level variables, so that they
> can communicate through shared state. Most evaluation steps involve a single
> step in a single expression, but certain synchronization primitives require
> multiple threads to progress together in one step.
> 
> 
> I take this to mean that multiple redexes can, at least potentially be
> evaluated concurrently, possibly synchronizing to get the order of
> evaluation right. But taken to an extreme, this sounds like overkill. Are
> threads routinely created to evaluate sub-expressions, or does this mean
> that expressions are potentially evaluated in a separate thread? Or is it
> maybe something completely different - that there are "threads" in the usual
> sense, and this passage should be taken as definitional (that threads are
> continuations?)

Yes - it's supposed to be about "threads" in the usual sense, which you
have to create explicitly.

I'll clarify that in the docs, along with the point that "actually
consists of multiple concurrent expressions" means up to one expression
per thread.


Matthew



Posted on the users mailing list.