Next: The Organization of Up: Parallelism with Collection: Previous: Method of Element

Thread Parallelism

Collection member functions that are not of type MethodOfElement are executed by the threads of the Processors Object in the same way that TEClass member functions are executed. That is, they are executed in SPMD/MIMD mode. For example, let the collection C structure take the form shown below.


Collection C: ... {
    int i, j;
  public:
    void h(int k){ i = k; j = MyProc()}
    ....
  MethodOfElement:
     virtual void f(int);
};
Let a collection X be be declared as follows.

    Processors P;
    Distribution d(..., &P, ...);
    Align a(....)
    C < E >  X(&a, &d, ...);
Each thread defined by the Processors object P will own a representative of the base collection TEClass defined by the non-MethodOfElement fields of C Then, if we invoke the operator

   X.h(3);
each thread will execute h(3) locally and modify its private copies of the variables i and j. Access to the local collection of element on each thread is described in the preceding sections.


beckman@cica.indiana.edu
Mon Nov 21 09:49:54 EST 1994