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: affinity/cpp-20/d0796r1.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,8 +128,6 @@ The interface for querying the **resource topology** of a **system** must be fle
128
128
129
129
> For example, an implementation may provide an execution context for a particular execution resource such as a static thread pool or a GPU context for a particular GPU device, or an implementation may provide a more generic execution context which can be constructed from a number of CPU and GPU devices queryable through the system resource topology.
130
130
131
-
...
132
-
133
131
### Topology discovery & fault tolerance
134
132
135
133
In traditional single-CPU systems, users may reason about the execution resources with standard constructs such as `std::thread`, `std::this_thread` and `thread_local`. This is because the C++ machine model requires that a system have **at least one thread of execution, some memory and some I/O capabilities**. Thus, for these systems, users may make some assumptions about the system resource topology as part of the language and its supporting standard library. For example, one may always ask for the available hardware concurrency, since there is always at least one thread, and one may always use thread-local storage.
@@ -358,9 +356,9 @@ If a particular policy or algorithm requires to access placement information, th
358
356
359
357
## Class `execution_resource`
360
358
361
-
The `execution_resource` class provides an abstraction over a system's hardware capable to allocate memory, execute light weight exeution agents or both. An `execution_resource` can represent further `execution_resource`s, these `execution_resource`s are said to be *members of* this `execution_resource`.
359
+
The `execution_resource` class provides an abstraction over a system's hardware capable to allocate memory, execute light weight execution agents or both. An `execution_resource` can represent further `execution_resource`s, these `execution_resource`s are said to be *members of* this `execution_resource`.
362
360
363
-
> [*Note:* The `execution_resource` is required to be implemented such that the underlying software abstraction is initialised on when the `execution_resource` is constructed, maintained through reference counting and cleaned up on destruction of the final reference. *--end note*]
361
+
> [*Note:* The `execution_resource` is required to be implemented such that the underlying software abstraction is initialised when the `execution_resource` is constructed, maintained through reference counting and cleaned up on destruction of the final reference. *--end note*]
364
362
365
363
### `execution_resource` constructors
366
364
@@ -383,7 +381,7 @@ The `execution_resource` class provides an abstraction over a system's hardware
383
381
384
382
size_t concurrency() const noexcept;
385
383
386
-
*Returns:* The collective concurrency available to this resource. More pecifically, the number of *threads of execution* collectively available to this `execution_resource` and any resources which are *members of*, recursively.
384
+
*Returns:* The total concurrency available to this resource. More specifically, the number of *threads of execution* collectively available to this `execution_resource` and any resources which are *members of*, recursively.
387
385
388
386
std::vector<resource> resources() const noexcept;
389
387
@@ -433,7 +431,7 @@ The `execution_context` class provides an abstraction for managing a number of l
433
431
434
432
~execution_context();
435
433
436
-
*Effects:* May or may not block to wait any work bveing executed on the *contained resource*.
434
+
*Effects:* May or may not block to wait any work being executed on the *contained resource*.
437
435
438
436
### `execution_context` operators
439
437
@@ -512,9 +510,9 @@ The free function `this_system::resources` is provided for retrieving the `execu
512
510
513
511
*Returns:* A std::vector containing all *system level resources*.
514
512
515
-
*Requires:* If `resources().size() > 0`, `resources()[0]` be the `execution_resource`corroponding to the current thread of execution. The value returned by `resources()` be the same at any point after the invocation of `main`.
513
+
*Requires:* If `this_system::resources().size() > 0`, `this_system::resources()[0]` be the `execution_resource`use by `std::thread`. The value returned by `this_system::resources()` be the same at any point after the invocation of `main`.
516
514
517
-
> [*TODO:* Returning a `std::vector` allows users to potentially manipulate the container of `execution_resource`s after it is returned, we may want to replace this with an alternative type which is more restrictive at a later date. *--end TODO*]
515
+
> [*TODO:* Returning a `std::vector` allows users to potentially manipulate the container of `execution_resource`s after it is returned, we may want to replace this with an alternative type which is more restrictive at a later date such as a range. *--end TODO*]
0 commit comments