[plt-scheme] Parallel execution

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Tue Jan 17 13:01:16 EST 2006

I assume your doing this for fun and interest, so I'll let you know about a
more schemey way to do multi-tasking based on continuations (much less
efficent, but much more theoretical fun).
http://www.cs.indiana.edu/~dyb/pubs/engines.pdf  I got this working under
guile, but not under plt as I couldn't figure how to define "lambda".


On 1/14/06, Gregory Woodhouse <gregory.woodhouse at sbcglobal.net> wrote:
> I've been working my way through SICP and am currently in chapter 3.
> Right now, I'm reading about parallel execution. The syntax they use is
> (parallel-execute <thunk> <thunk> ...)
> I'm not sure how to do the same thing in PLT Scheme, but I did try
> (begin (thread (lambda () (display "A"))) (thread (lambda () (display
> "B"))))
> and sometimes get "AB" and sometimes "BA" (as I had hoped). So, how
> do begin and thread interact? I had expected that I'd see "AB" much
> more often than "BA" because I thought each thread would be scheduled
> as soon a (thread <thunk>) was evaluated. But now, I wonder how
> thread is implemented, and if none of the threads would actually run
> until the begin block was evaluated. Then I began to wonder how if
> there was just one "engine" (for lack of a better term) carrying out
> a single reduction in each thread and then moving on to another
> (round robin scheduling?)
> Just wondering.
> ===
> Gregory Woodhouse
> gregory.woodhouse at sbcglobal.net
> "The whole of science is nothing more than a refinement
>   of everyday thinking."  -- Albert Einstein
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

((lambda (y) (y y)) (lambda (y) (y y)))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20060117/475f2714/attachment.html>

Posted on the users mailing list.