Re: question about tasks, multithreading and multi-cpu machines



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
.



Relevant Pages

  • Re: reading a text file into a string
    ... zork wrote: ... Read: loop ... Max) or a line terminator is encountered, ... "The time has come to act, and act fast. ...
    (comp.lang.ada)
  • Re: Newbie question about tuples and list comprehensions
    ... I second Matt's comment about using a boring old for loop when ... it is the simplest way to express what you want to do. ... only obfuscate. ...
    (comp.lang.python)
  • Re: Threading, Loops, and Direct3D
    ... I appologise for the vagueness of the last, post, but my code is very ... complicated and by the time I'd gotten around to producing the simplest ... Moving it to a higher context (out of the while loop) fixed it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Numeric one-way hash function
    ... >> The simplest way to ensure that the bar codes are ... > don't understand your algorithm. ... end loop ...
    (sci.crypt)
  • Re: Modulo exponentiation 2 bits at a time.
    ... I'm looking for reference on a modulo exponentiation algorithm that ... algorithm that just use 1 bit for each loop. ... The loop in the simplest algo is something like: ... Add 'window' to your google search. ...
    (sci.math)

Loading