Document Number: | N3071=10-0061 |
Date: | 2010-03-10 |
Project: | Programming Language C++ |
Detlef Vollmann <dv@vollmann.ch>
N2996 introduced two new function calls async
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.
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:
Some of these future mechanisms might want to use the existing
async
function, just with a different launch policy.
With this in mind, the naming of launch::any
is
unfortunate, as it only allows for "calling in another thread"
and "calling in the same thread".
So I propose to change launch::any
to
launch::sync_or_async
.
In 30.6.1 [futures.overview], header <future>
synopsis, enum class launch
:
Change:
anysync_or_async
In 30.6.9 [futures.async], paragraph 2, Effects clause:
Change:
Effects:
The first function behaves the same as a call to the second function
with a policy argument of launch::
and
the same arguments for anysync_or_asyncF
and Args
.
And in the tird bullet:
Change:
launch::anysync_or_async
— the implementation may choose either
policy above at any call to async
.