quoth Christian:
To proove my point, I've put together a parallel map implementation (see attachment; semaphore implementation based on example from the manual). I haven't tested it on Marc's code, since I don't have a multiprocessor machine.
I just made a parallel map myself the other day, but mine's pretty different. So, for the sake of posterity, I've attached it.
0) it's actually a for-each here. Moreover, it's a poorly named for-each that returns the number of iterations.
0.1) Several of these maps operate on streams, I defined those myself, in terms of (fold-anything cons car cdr null? nil list).
1) it's still a bit incomplete. There's no parallel limit -- I'm going to capture out of memory exceptions instead. I don't like the idea of a limit -- I want to go until I run out of juice.
2) Some of the names are bit fanciful and/or incorrect -- it's a weakness of mine. "Incorrect" is a result of being a new scheme programmer, and new to formal computing terms in general; "fanciful" is exhibited by the name "kermit", because it's reporter, you see, and I was wearing a sesame street t-shirt at coding time.
3) I have tested this, and it's performance was entirely satisfactory.
4) the reporting thread exits when it's received as many messages as the count stored in it's specific field. the main loop joins the reporting thread with a timeout, which is my el-cheapo method for dropping pending operations on the floor, since they will errors after some point in time for my purposes.
Criticism welcome.
Lang