This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51617] [C++0x] async(f) isn't.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Dec 2011 10:43:22 +0000
- Subject: [Bug libstdc++/51617] [C++0x] async(f) isn't.
- Auto-submitted: auto-generated
- References: <bug-51617-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51617
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-19 10:43:22 UTC ---
Yes, this was an intentional choice (as I described in message
c++std-lib-30840) to ensure the system doesn't get killed by a fork bomb, e.g.
writing a parallel sort algorithm using async which launches a new thread for
every partition. I tried it, it wasn't pretty :)
At some point I will use getloadavg() or equivalent functionality to check the
system load and decide whether to launch a new thread or not, until then the
safer choice is to require a user to explicitly request it (then it's the
user's fault if they fork bomb their machine!)