Skip to content

Commit

Permalink
Merge pull request #47 from cplusplus/D4505
Browse files Browse the repository at this point in the history
D4505
  • Loading branch information
jaredhoberock committed May 11, 2015
2 parents 0882411 + ce24efc commit 7677eea
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 118 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
Document Number: N4408
Date: 2015-04-10
Document Number: N4506
Date: 2015-05-05
Revises:
Project: Programming Language C++
Project Number: TS 19570
Reply-to: Jared Hoberock
NVIDIA Corporation
[email protected]

# Parallelism TS Editor's Report, pre-Lenexa mailing
# Parallelism TS Editor's Report, post-Lenexa mailing

N4407 is the latest Parallelism TS Working Draft. It contains editorial changes to the Parallelism TS to address whitespace and other formatting issues.
N4505 is the latest Parallelism TS Working Draft. It contains editorial and technical changes to the Parallelism TS to apply the following revisions:

N4407 updates the previous draft, N4352, published in the midterm mailing.
* N4274 - Relaxing Packing Rules for Exceptions Thrown by Parallel Algorithms - Proposed Wording (Revision 1)
* Feature test macro for the Parallelism TS

N4409 is document N4407 reformatted as a TS document. It updates N4354, which was published in the midterm mailing.
N4505 updates the previous draft, N4407, published in the pre-Lenexa mailing.

N4507 is document N4505 reformatted as a TS document. It updates N4409, which was published in the pre-Lenexa mailing.

## Technical Changes

* Applied N4274, which relaxes the exception packaging rules for exceptions thrown by parallel algorithms. Additionally, changed instances of "terminates with (exception)" phrasing to "exits via (exception)", as directed by the Library Working Group.

* Introduced the feature test macro `__cpp_lib_experimental_parallel_algorithm` for the functionality of the Parallelism TS as directed by SG1.

## Editorial Changes

Eliminated spurious whitespace and paragraph numbers and manually broke code lines which were spilling into the margin.
* Promoted subsection 1.3.1, which was incorrectly grouped under section 1.3, to section 1.4.

23 changes: 12 additions & 11 deletions exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Exception reporting behavior</h1>
</p>
<p>
During the execution of a standard parallel algorithm, if the invocation of an element access function
terminates with an uncaught exception, the behavior of the program is determined by the type of
<ins>exits via</ins><del>terminates with</del> an uncaught exception, the behavior of the program is determined by the type of
execution policy used to invoke the algorithm:

<ul>
Expand All @@ -19,29 +19,30 @@ <h1>Exception reporting behavior</h1>
</li>
<li>
If the execution policy object is of type <code>sequential_execution_policy</code> or
<code>parallel_execution_policy</code>, the execution of the algorithm terminates with an
<code>exception_list</code> exception. All uncaught exceptions thrown during
the invocations of element access functions shall be contained in the
<code>exception_list</code>.<pre>
<code>parallel_execution_policy</code>, the execution of the algorithm <ins>exits via</ins><del>terminates with</del> an
<del><code>exception_list</code></del> exception. <ins>The exception shall be an <code>exception_list</code> containing all</ins><del>All</del> uncaught exceptions thrown during
the invocations of element access functions<ins>, or optionally the uncaught exception if there was only one</ins><del>shall be contained in the
<code>exception_list</code></del>.<pre>
</pre>

<cxx-note>
For example, the number of invocations of the user-provided function object in
<code>for_each</code> is unspecified. When <code>for_each</code> is executed sequentially,
only one exception will be contained in the <code>exception_list</code> object.
For example, <del>the number of invocations of the user-provided function object in
<code>for_each</code> is unspecified. W</del><ins>w</ins>hen <code>for_each</code> is executed sequentially,
<ins>if an invocation of the user-provided function object throws an exception, <code>for_each</code> can exit via the uncaught exception, or throw an <code>exception_list</code> containing the original exception.
<del>only one exception will be contained in the <code>exception_list</code> object.</del>
</cxx-note><pre>
</pre>

<cxx-note>
These guarantees imply that, unless the algorithm has failed to allocate memory and
terminated with <code>std::bad_alloc</code>, all exceptions thrown during the execution of
<ins>exits via</ins><del>terminated with</del> <code>std::bad_alloc</code>, all exceptions thrown during the execution of
the algorithm are communicated to the caller. It is unspecified whether an algorithm implementation will "forge ahead" after
encountering and capturing a user exception.
</cxx-note><pre>
</pre>
<cxx-note>
The algorithm may terminate with the <code>std::bad_alloc</code> exception even if one or more
user-provided function objects have terminated with an exception. For example, this can happen when an algorithm fails to allocate memory while
The algorithm may <ins>exit via</ins><del>terminate with</del> the <code>std::bad_alloc</code> exception even if one or more
user-provided function objects have <ins>exited via</ins><del>terminated with</del> an exception. For example, this can happen when an algorithm fails to allocate memory while
creating or adding elements to the <code>exception_list</code> object.
</cxx-note>
</li>
Expand Down
6 changes: 3 additions & 3 deletions front_matter.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<cxx-titlepage stage="draft">
<cxx-docnum>N4407</cxx-docnum>
<cxx-docnum>N4505</cxx-docnum>
<cxx-project-number>19570</cxx-project-number>
<time pubdate="">2015-04-10</time>
<cxx-revises><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4352.html">N4352</a></cxx-revises>
<time pubdate="">2015-05-05</time>
<cxx-revises><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4407.html">N4407</a></cxx-revises>
<cxx-editor>
Jared Hoberock<br/>
NVIDIA Corporation<br/>
Expand Down
100 changes: 69 additions & 31 deletions general.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,51 +70,89 @@ <h1>Namespaces and headers</h1>
<pre>
<code> #include &lt;meow&gt;</code>
</pre>
</cxx-section>

<cxx-section id="parallel.general.defns">
<h1>Terms and definitions</h1>
<cxx-section id="parallel.general.defns">
<h1>Terms and definitions</h1>

<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>

<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel::v1</code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>

<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>
<p>
Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions:

<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel::v1</code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>
<ul>
<li>
All operations of the categories of the iterators that the algorithm is instantiated with.
</li>

<p>
Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions:
<li>
Functions on those sequence elements that are required by its specification.
</li>

<li>
User-provided function objects to be applied during the execution of the algorithm, if required by the specification.
</li>

<ins><li>
Operations on those function objects required by the specification.

<cxx-note>
See clause 25.1 of <em>C++ Standard Algorithms Library</em>.
</cxx-note>
</li></ins>
</ul>

These functions are herein called <em>element access functions</em>.

<cxx-example>
The <code>sort</code> function may invoke the following element access functions:

<ul>
<li>
All operations of the categories of the iterators that the algorithm is instantiated with.
Methods of the random-access iterator of the actual template argument, as per 24.2.7, as implied by the name of the
template parameters <code>RandomAccessIterator</code>.
</li>

<li>
Functions on those sequence elements that are required by its specification.
The <code>swap</code> function on the elements of the sequence (as per 25.4.1.1 [sort]/2).
</li>

<li>
User-provided function objects to be applied during the execution of the algorithm, if required by the specification.
The user-provided <code>Compare</code> function object.
</li>
</ul>

These functions are herein called <em>element access functions</em>.

<cxx-example>
The <code>sort</code> function may invoke the following element access functions:

<ul>
<li>
Methods of the random-access iterator of the actual template argument, as per 24.2.7, as implied by the name of the
template parameters <code>RandomAccessIterator</code>.
</li>

<li>
The <code>swap</code> function on the elements of the sequence (as per 25.4.1.1 [sort]/2).
</li>

<li>
The user-provided <code>Compare</code> function object.
</li>
</ul>
</cxx-example>
</cxx-section>
</cxx-example>
</cxx-section>

<cxx-section id="parallel.general.features">
<ins>
<h1>Feature-testing recommendations</h1>
<p>An implementation that provides support for this Technical Specification shall define the feature test macro(s) in Table 1.</p>

<table is="cxx-table" class="column-rules">
<caption>Feature Test Macro(s)</caption>

<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Header</th>
</tr>
<tr>
<td><code>__cpp_lib_experimental_parallel_algorithm</code></td>
<td>201505</td>
<td>
<code>&lt;experimental/algorithm&gt;</code><br>
<code>&lt;experimental/exception_list&gt;</code><br>
<code>&lt;experimental/execution_policy&gt;</code><br>
<code>&lt;experimental/numeric&gt;</code>
</td>
</tr>
</thead>
</table>
</ins>
</cxx-section>
</cxx-clause>

Loading

0 comments on commit 7677eea

Please sign in to comment.