From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3f60acc31578c72b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: question about tasks, multithreading and multi-cpu machines References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.214.7.86 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1142624537 12.214.7.86 (Fri, 17 Mar 2006 19:42:17 GMT) NNTP-Posting-Date: Fri, 17 Mar 2006 19:42:17 GMT Date: Fri, 17 Mar 2006 19:42:17 GMT Xref: g2news1.google.com comp.lang.ada:3410 Date: 2006-03-17T19:42:17+00:00 List-Id: Maciej Sobczak wrote: > > Consider a simple example of two long vectors that need to be added. In > the simplest case you do this: > > for I in Vector'Range loop > V3(I) := V1(I) + V2(I); > end loop; > > and you're done. No, in all cases you should do V3 := V1 + V2; with an appropriate definition of "+" (which may be similar to your example). > Now, assume that you want to target dual-CPU machine and you *know* that > you could greatly benefit from making things in paraller. Then this is part of your requirements, and should be reflected in your design and implementation. Incidentally, the English word is "parallel". The interesting problem is writing portable code that takes advantage of N processors (N = 1, 2, 3, ...), with N unknown until run time. -- Jeff Carter "The time has come to act, and act fast. I'm leaving." Blazing Saddles 36