On Tue, Jan 25, 2011 at 10:21 AM, Michael Gardner <gardne...@gmail.com> wrote:
> On Jan 25, 2011, at 9:06 AM, Ken Wesson wrote:
>
>> sh is asynchronous. It calls Runtime/exec, which launches the sleep as
>> a separate process and immediately returns a Process object (which
>> your pmap should be returning a seq of). It may produce n+2 Process
>> objects at a time but it produces them all before the first of the
>> asynchronous sleep processes finishes, so for a while all of the
>> latter are running at the same time.
>
> Really? The documentation for sh claims to return a map, which is what I 
> observe.
Well, that's weird, because the documentation *I* read says it
composits the arguments together into a command line and hands off to
Runtime/exec. And the documentation of *that* says it returns a
Process object and the process it launches runs asynchronously.

> And the call to sh doesn't return until the sub-process has finished

If that were the case, though, your pmap should indeed only be running
cores+2 instances at once. Which is not what you observed.

Something's hinky here.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to