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

Re: Multi-core loops

On Sun, Jun 28, 2009 at 9:25 AM, Nadav Har'El<nyh@xxxxxxxxxxxxxxxxxxx> wrote:
> So I think there is definitely a need for such a parallel loop feature.

I totally agree...

There are lots of cases where you don't want to "flood" a destination
with too many concurrent requests, where you might have hundreds or
thousands of items to request, and where
 - serializing 1 at a time is too few
 - spawning 1000 at a time is too many
 - keeping 10 processes busy might be about right

CPU's not the only reason to parallelize; other reasons include:
 - network traffic (3 web servers, hence 3 requests at a time)
 - I/O (disk array with 12 drives, can support 6 copies at a time)
 - DBMS supports 8 connections at a time for your favorite user
Alfred Hitchcock  - "Television has brought back murder into the home
- where it belongs." -

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