Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Multi-core loops



On Sun, Jun 28, 2009 at 8:31 AM, Nadav Har'El <nyh@xxxxxxxxxxxxxxxxxxx> wrote:
> Zsh, like all shells, lets you easily do something many times in a loop.
> E.g.,
>
> Â Â Â Âfor i in ...
> Â Â Â Âdo
> Â Â Â Â Â Â Â Âdosomething $i
> Â Â Â Âdone
>
> But when "dosomething" is CPU intensive, this is *not* what you'd want to
> do on a multi-core (multi CPU) machine, which have more-or-less become
> standard nowadays...
> Such a loop would only use one of the CPUs, and leave the other(s) unused.
> Instead, you'll want to keep all CPUs busy all the time, running M (=number
> of CPUs) processes at the same time.

Any update on this?

I'm searching for a solution. Perhaps this can't be done as a built-in
syntax but what about a more complex solution. I'm a noob (and with
the numbers of features of zsh, I'm gonna be a noob forever), and cant
find a small, beautiful, zsh-is-so-cool-ish solution for it and dont
know how to effective implement it e.g., without using python, I like
some zsh only solution.

How people solved this problem any home-made solution for this, any tip?

Thanks!

-- 
ÂDans la vie, rien n'est à craindre, tout est à comprendreÂ
Marie Sklodowska Curie.



Messages sorted by: Reverse Date, Date, Thread, Author