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

Re: Multi-core loops



11/23/2009 12:05 AM, Kazuo Teramoto::
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?

What if "dosomething" has hundreds of childs processes?
It would use all the available cores.

--
      Architecte Informatique chez Blueline/Gulfsat:
   Administration Systeme, Recherche & Developpement
                                   +261 33 11 207 36



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