Skip to content

Commit d01d906

Browse files
GordonGordon
authored andcommitted
Add minor corrections.
* Add typo fixes. * Change requirement for this_system::resources()[0] to be the resource used by std::thread.
1 parent 61bae2e commit d01d906

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

affinity/cpp-20/d0796r1.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ The interface for querying the **resource topology** of a **system** must be fle
128128
129129
> 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.
130130
131-
...
132-
133131
### Topology discovery & fault tolerance
134132
135133
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
358356

359357
## Class `execution_resource`
360358

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`.
362360

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*]
364362
365363
### `execution_resource` constructors
366364

@@ -383,7 +381,7 @@ The `execution_resource` class provides an abstraction over a system's hardware
383381

384382
size_t concurrency() const noexcept;
385383

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.
387385

388386
std::vector<resource> resources() const noexcept;
389387

@@ -433,7 +431,7 @@ The `execution_context` class provides an abstraction for managing a number of l
433431

434432
~execution_context();
435433

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*.
437435

438436
### `execution_context` operators
439437

@@ -512,9 +510,9 @@ The free function `this_system::resources` is provided for retrieving the `execu
512510

513511
*Returns:* A std::vector containing all *system level resources*.
514512

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`.
516514

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*]
518516
519517
# Future Work
520518

0 commit comments

Comments
 (0)