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).
<a href="http://www.cs.indiana.edu/~dyb/pubs/engines.pdf">http://www.cs.indiana.edu/~dyb/pubs/engines.pdf</a> I got this
working under guile, but not under plt as I couldn't figure how to
define "lambda".<br>
<br>
Corey<br>
<br><br><div><span class="gmail_quote">On 1/14/06, <b class="gmail_sendername">Gregory Woodhouse</b> <<a href="mailto:gregory.woodhouse@sbcglobal.net">gregory.woodhouse@sbcglobal.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've been working my way through SICP and am currently in chapter 3.<br>Right now, I'm reading about parallel execution. The syntax they use is<br><br>(parallel-execute <thunk> <thunk> ...)<br><br>I'm not sure how to do the same thing in PLT Scheme, but I did try
<br><br>(begin (thread (lambda () (display "A"))) (thread (lambda () (display<br>"B"))))<br><br>and sometimes get "AB" and sometimes "BA" (as I had hoped). So, how<br>do begin and thread interact? I had expected that I'd see "AB" much
<br>more often than "BA" because I thought each thread would be scheduled<br>as soon a (thread <thunk>) was evaluated. But now, I wonder how<br>thread is implemented, and if none of the threads would actually run
<br>until the begin block was evaluated. Then I began to wonder how if<br>there was just one "engine" (for lack of a better term) carrying out<br>a single reduction in each thread and then moving on to another<br>
(round robin scheduling?)<br><br>Just wondering.<br><br>===<br>Gregory Woodhouse<br><a href="mailto:gregory.woodhouse@sbcglobal.net">gregory.woodhouse@sbcglobal.net</a><br><br>"The whole of science is nothing more than a refinement
<br> of everyday thinking." -- Albert Einstein<br><br><br><br>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></blockquote></div><br><br clear="all"><br>-- <br>((lambda (y) (y y)) (lambda (y) (y y)))