Skip to content

Commit 05be7ed

Browse files
authored
Merge pull request MicrosoftDocs#3307 from AlexGuteniev/master
Mention limits of concurrency
2 parents 95eee86 + 7a971b2 commit 05be7ed

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

docs/standard-library/execution.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: <execution>"
33
title: "<execution>"
4-
ms.date: "01/15/2021"
4+
ms.date: "08/17/2021"
55
f1_keywords: ["<execution>", "execution/std::execution", "std::execution"]
66
helpviewer_keywords: ["execution header"]
77
---
@@ -31,11 +31,15 @@ namespace std::execution {
3131
|[`parallel_unsequenced_policy` Class](parallel-unsequenced-policy-class.md)|Used as a unique type to disambiguate parallel algorithm overloading. Indicates that a parallel algorithm’s execution may be parallelized and vectorized.|
3232
|[`sequenced_policy` Class](sequenced-policy-class.md)|Used as a unique type to disambiguate parallel algorithm overloading. Specifies that a parallel algorithm’s execution may not be parallelized.|
3333
34+
### Microsoft Specific
35+
36+
When `parallel_policy` or `parallel_unsequenced_policy` cause the algorithm to be parallelized, the parallel execution uses Windows Thread Pool; see [Thread Pools](/windows/win32/procthread/thread-pools). The number of concurrent threads is limited to the thread pool default (currently 500). The number of threads concurrently executing on hardware is currently limited by the number of logical processors in the current process's processor group, so it is effectively limited to 64; see [Processor Groups](/windows/win32/procthread/processor-groups). The maximum number of chunks for data partitioning is also currently based on the number of logical processors in the current process's processor group.
37+
3438
## Requirements
3539
3640
**Header:** \<execution>
3741
38-
**Namespace:** stdext
42+
**Namespace:** std
3943
4044
## See also
4145

docs/standard-library/future-functions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: &lt;future&gt; functions"
33
title: "&lt;future&gt; functions"
4-
ms.date: "11/04/2016"
4+
ms.date: "08/17/2021"
55
f1_keywords: ["future/std::async", "future/std::future_category", "future/std::make_error_code", "future/std::make_error_condition", "future/std::swap"]
66
ms.assetid: 1e3acc1e-736a-42dc-ade2-b2fe69aa96bc
77
helpviewer_keywords: ["std::async [C++]", "std::future_category [C++]", "std::make_error_code [C++]", "std::make_error_condition [C++]", "std::swap [C++]"]
@@ -60,6 +60,10 @@ In all cases, the associated asynchronous state of the `future` object is not se
6060
6161
The pseudo-function `INVOKE` is defined in [\<functional>](../standard-library/functional.md).
6262
63+
### Microsoft Specific
64+
65+
When the passed function is executed asynchronously, it is executed on Windows Thread Pool; see [Thread Pools](/windows/win32/procthread/thread-pools). The number of concurrent threads is limited to the thread pool default (currently 500). The number of threads concurrently executing on hardware is currently limited by the number of logical processor in the process's processor group, so it is effectively limited to 64; see [Processor Groups](/windows/win32/procthread/processor-groups).
66+
6367
## <a name="future_category"></a> future_category
6468
6569
Returns a reference to the [error_category](../standard-library/error-category-class.md) object that characterizes errors that are associated with `future` objects.

docs/standard-library/thread-class.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: thread Class"
33
title: "thread Class"
4-
ms.date: "11/04/2016"
4+
ms.date: "08/17/2021"
55
f1_keywords: ["thread/std::thread", "thread/std::thread::id Class", "thread/std::thread::thread", "thread/std::thread::detach", "thread/std::thread::get_id", "thread/std::thread::hardware_concurrency", "thread/std::thread::join", "thread/std::thread::joinable", "thread/std::thread::native_handle", "thread/std::thread::swap"]
66
ms.assetid: df249bc7-ff81-4ff9-a6d6-5e3d9a8f56a1
77
helpviewer_keywords: ["std::thread [C++]", "std::thread [C++], thread", "std::thread [C++], detach", "std::thread [C++], get_id", "std::thread [C++], hardware_concurrency", "std::thread [C++], join", "std::thread [C++], joinable", "std::thread [C++], native_handle", "std::thread [C++], swap"]
@@ -100,6 +100,12 @@ static unsigned int hardware_concurrency() noexcept;
100100

101101
An estimate of the number of hardware thread contexts. If the value cannot be computed or is not well defined, this method returns 0.
102102

103+
### Microsoft Specific
104+
105+
`hardware_concurrency` is currently defined to return the number of logical processors, which corresponds to the number of hardware threads that can execute simultaneously. It takes into account the number of physical processors, the number of cores in each physical processor, and simultaneous multithreading on each single core.
106+
107+
However, on systems with more than 64 logical processors this number is capped by the number of logical processor in a single group; see [Processor Groups](/windows/win32/procthread/processor-groups).
108+
103109
## <a name="id_class"></a> thread::id Class
104110

105111
Provides a unique identifier for each thread of execution in the process.

0 commit comments

Comments
 (0)