* [patch] libstdc++/56117 make std::async launch new threads by default
@ 2015-05-02 18:56 Jonathan Wakely
2015-05-05 1:58 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2015-05-02 18:56 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 558 bytes --]
One last patch before I head to Lenexa, this fixes the long standing
not-a-bug that our default launch policy is launch::deferred.
This way std::async with no explicit policy or with any policy that
contains launch::async will run in a new thread.
Apparently libc++ does the same and they aren't getting lots of
complaints about fork-bombs, so let's try the same thing. If people
don't like it we have plenty of time in stage 1 to reconsider.
Tested x86_64-linux and powerpc64le-linux, I'm going to commit this to
trunk unless someone strongly objects.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 885 bytes --]
commit cb6dfe604295873cebd5b3a53b10b1e882eb3cff
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sat May 2 19:27:10 2015 +0100
PR libstdc++/51617
* include/std/future (async): Change default policy to launch::async.
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index fc3f816..a67db98 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -1704,7 +1704,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
typedef typename result_of<_Fn(_Args...)>::type result_type;
std::shared_ptr<__future_base::_State_base> __state;
- if ((__policy & (launch::async|launch::deferred)) == launch::async)
+ if ((__policy & launch::async) == launch::async)
{
__state = __future_base::_S_make_async_state(std::__bind_simple(
std::forward<_Fn>(__fn), std::forward<_Args>(__args)...));
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] libstdc++/56117 make std::async launch new threads by default
2015-05-02 18:56 [patch] libstdc++/56117 make std::async launch new threads by default Jonathan Wakely
@ 2015-05-05 1:58 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2015-05-05 1:58 UTC (permalink / raw)
To: libstdc++, gcc-patches
On 02/05/15 19:56 +0100, Jonathan Wakely wrote:
>One last patch before I head to Lenexa, this fixes the long standing
>not-a-bug that our default launch policy is launch::deferred.
>
>This way std::async with no explicit policy or with any policy that
>contains launch::async will run in a new thread.
>
>Apparently libc++ does the same and they aren't getting lots of
>complaints about fork-bombs, so let's try the same thing. If people
>don't like it we have plenty of time in stage 1 to reconsider.
>
>Tested x86_64-linux and powerpc64le-linux, I'm going to commit this to
>trunk unless someone strongly objects.
Committed to trunk.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-05 1:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-02 18:56 [patch] libstdc++/56117 make std::async launch new threads by default Jonathan Wakely
2015-05-05 1:58 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).