Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The allocation of source data elements to threads is an integral part of the initialization phase for each thread. This ensures that the worker threads divide the source and target data spaces in a manner that is conducive to parallel processing. The goal is to enable the threads to operate independently without interference from each other. It’s crucial to avoid scenarios where one thread’s written data would necessitate changes in another thread’s source data. Similarly, it’s important to prevent overlap in the target data space of two or more threads to ensure consistent results. If these conditions cannot be met, the process may not be suitable for parallel processing.

Data allocation is provided only within scope of parallel dimension (process parameter pDimPar). The other parameter values defining the source and target data space should be shared between each worker thread .

Allocation of source data is based on pThreadID parameter value is provided by the modulo logic as depicted on below example. Number of working threads pMaxThreads was set to 4, main thread is not participating in the data processing. Child threads have pThreadID set to 1, 2 and 3. For simplicity elements in parallel dimension have symbolic names A, B, C, D, E, F, G, H and I.

...

Element

...

A

...

B

...

C

...

D

...

E

...

F

...

G

...

H

...

I

...

J

...

Thread

...

1

...

2

...

3

...

1

...

2

...

3

...

1

...

2

...

3

...

1

and main thread.

Note

Each thread is responsible to allocate its own data elements in both in the source and in the target dimensions. Target view for cleaning and the cleaning itself must be provided by the thread itself. All objects such as views or subsets must be created as temporary.