Previous: Structuring Up: Structured Parallel Blocks: par Next: Nesting

Sharing Data

Because the actions contained in different threads of control in a parallel block are executed in a parallel, or possibly arbitrarily interleaved, manner, it should be clear that sharing and modifying data between such threads can be dangerous. The CC++ language allows you to do dangerous things. However, you can stay out of trouble by following a simple rule. First a definition:

___________________________________________________

paolo@cs.caltech.edu