<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <title>N3042: Renaming launch::any and what asyncs really might be</title>
  </head>

  <body>
<table>
  <tr>
    <td align="left">Document Number:</td>
    <td align="left">N3042=10-0032</td>
  </tr>
  <tr>
    <td align="left">Date:</td>
    <td align="left">2010-02-15</td>
  </tr>
  <tr>
    <td align="left">Project:</td>
    <td align="left">Programming Language C++</td>
  </tr>
</table>
<p>
Detlef Vollmann &lt;<a href="mailto:dv@vollmann.ch">dv@vollmann.ch</a>&gt;<br/>
</p>
<h1>N3042: Renaming launch::any and what asyncs really might be</h1>

<h2>Introduction</h2>
<p>
N2996 introduced two new function calls <code>async</code> to start
some function asynchronously and return a future
to obtain the result of the function.
N2996 allowed for two mechanisms to run that function: in another thread
or as deferred function in the same thread.
</p>

<h2>Discussion</h2>
<p>
The two launching mechanisms defined by N2996 make sense for the current
revision of the standard, but future revisions of C++ might allow for
a much larger variety of launching mechanisms.
Some potential mechanisms might be:
</p>
<ul>
  <li>launching in a specific thread pool</li>
  <li>launching in a separate process</li>
  <li>launching on a different computing unit (such as GPU)</li>
  <li>...</li>
</ul>
<p>
Some of these future mechanisms might want to use the existing
<code>async</code> function, just with a different launch policy.
With this in mind, the naming of <code>launch::any</code> is
unfortunate, as it only allows for "calling in another thread"
and "calling in the same thread".
</p>
<p>So I propose to change <code>launch::any</code> to
<code>launch::any_sync</code>.
</p>

<h2>Proposed Changes</h2>
<p>
In 30.6.1 [futures.overview], header <code>&lt;future&gt;</code> synopsis, <code>enum class launch</code>:<br/>
Change:
</p>
<pre>
any
</pre>
<p>to</p>
<pre>
any_sync
</pre>

</body>
</html>




