Previous: Introduction Up: No Title Next: Atomicity

Creating Parallel Threads of Control

Fundamental to any parallel programming language is the mechanism by which parallel threads of control are created. In this chapter we introduce the three mechanisms used in CC++:

par :
structured parallel block construct
parfor :
structured parallel loop construct
spawn :
unstructured parallelism

It is important to note that these constructs do not actually distribute work, or describe where work is to be performed. They simply describe possible concurrency in a program. If, for example, the program is being executed on one single-processor workstation, at most one thread can be executed at any point in time and hence no performance speed-up will be observed. In this case, the actions of the statements composed in parallel by the above constructs will execute in some arbitrarily interleaved fashion.

___________________________________________________

paolo@cs.caltech.edu