Parallel Iteration
The types const_range_type and range_type model the Range Concept and provide methods to access the bounds of the range, as shown in Table 5-5. The types differ only in that the bounds for a const_range_type are of type const_iterator, whereas the bounds for a range_type are of type iterator.
Use the range types in conjunction with parallel_for, parallel_reduce, and parallel_scan to iterate over pairs in a concurrent_hash_map.
Table 5-5. Concept for concurrent_hash_map range R
|
Pseudosignature |
Semantics |
|---|---|
|
|
First item in range |
|
|
One past last item in range |
-
const_range_type range( size_t grainsize ) const Effects: constructs a
const_range_typerepresenting all keys in the table. Thegrainsizeparameter is in units of hash table slots. Each slot typically has only one key-value pair.Returns: a
const_range_typeobject for the table.-
range_type range( size_t grainsize ) Returns: like
const_range_type, but returns arange_typeobject for the table.