You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/parallel/concrt/how-to-use-a-message-block-filter.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Because the `transformer` object receives only prime numbers, the `transformer`
32
32
33
33
The `transformer` object now processes only those values that are prime. In the previous example, `transformer` object processes all messages. Therefore, the previous example must receive the same number of messages that it sends. This example uses the result of the [concurrency::send](reference/concurrency-namespace-functions.md#send) function to determine how many messages to receive from the `transformer` object. The `send` function returns **`true`** when the message buffer accepts the message and **`false`** when the message buffer rejects the message. Therefore, the number of times that the message buffer accepts the message matches the count of prime numbers.
Copy file name to clipboardExpand all lines: docs/parallel/concrt/how-to-use-exception-handling-to-break-from-a-parallel-loop.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The following example creates a `tree` object and searches it for several values
40
40
41
41
This example uses the [concurrency::parallel_invoke](reference/concurrency-namespace-functions.md#parallel_invoke) algorithm to search for values in parallel. For more information about this algorithm, see [Parallel Algorithms](../../parallel/concrt/parallel-algorithms.md).
Copy file name to clipboardExpand all lines: docs/parallel/concrt/how-to-use-parallel-containers-to-increase-efficiency.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This topic shows how to use parallel containers to efficiently store and access
10
10
11
11
The example code computes the set of prime and Carmichael numbers in parallel. Then, for each Carmichael number, the code computes the prime factors of that number.
12
12
13
-
## Example: is_prime function
13
+
## Example: Determine if an input value is a prime number
14
14
15
15
The following example shows the `is_prime` function, which determines whether an input value is a prime number, and the `is_carmichael` function, which determines whether the input value is a Carmichael number.
16
16
@@ -24,23 +24,23 @@ This example uses a [concurrency::concurrent_queue](../../parallel/concrt/refere
## Example: Find all prime factors of a given value
28
28
29
29
The following example shows the `prime_factors_of` function, which uses trial division to find all prime factors of the given value.
30
30
31
31
This function uses the [concurrency::parallel_for_each](reference/concurrency-namespace-functions.md#parallel_for_each) algorithm to iterate through the collection of prime numbers. The `concurrent_vector` object enables the parallel loop to concurrently add prime factors to the result.
## Example: Processes each element in the queue of Carmichael numbers
36
36
37
37
This example processes each element in the queue of Carmichael numbers by calling the `prime_factors_of` function to compute its prime factors. It uses a task group to perform this work in parallel. For more information about task groups, see [Task Parallelism](../../parallel/concrt/task-parallelism-concurrency-runtime.md).
38
38
39
39
This example prints the prime factors for each Carmichael number if that number has more than four prime factors.
This example shows how to use the [concurrency::parallel_invoke](reference/concurrency-namespace-functions.md#parallel_invoke) algorithm to improve the performance of a program that performs multiple operations on a shared data source. Because no operations modify the source, they can be executed in parallel in a straightforward manner.
10
10
11
-
## Example: Create MyDataType variable
11
+
## Example: Create, initialize, and perform operations on a variable
12
12
13
13
Consider the following code example that creates a variable of type `MyDataType`, calls a function to initialize that variable, and then performs multiple lengthy operations on that data.
Copy file name to clipboardExpand all lines: docs/parallel/concrt/how-to-write-a-parallel-for-loop.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The following example shows the `parallel_matrix_multiply` function, which uses
22
22
23
23
This example parallelizes the outer loop only because it performs enough work to benefit from the overhead for parallel processing. If you parallelize the inner loop, you will not receive a gain in performance because the small amount of work that the inner loop performs does not overcome the overhead for parallel processing. Therefore, parallelizing the outer loop only is the best way to maximize the benefits of concurrency on most systems.
0 commit comments