public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dave at boostpro dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/51617] [C++0x] async(f) isn't. Date: Mon, 19 Dec 2011 11:04:00 -0000 [thread overview] Message-ID: <bug-51617-4-R5FdzqdJJ5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-51617-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51617 --- Comment #4 from Dave Abrahams <dave at boostpro dot com> 2011-12-19 10:58:46 UTC --- (In reply to comment #2) > 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 :) Hey, cool; I tried it too. I mean, when I discovered async wasn't async. :-) > 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!) Yeah, but in the meantime you could also just limit async() threads to hardware_concurrency() using the technique shown in my attachment. It wouldn't necessarily guarantee good performance but it would be enough to prevent async from fork bombing while still allowing some semi-intelligent amount of parallelism.
next prev parent reply other threads:[~2011-12-19 10:59 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-12-19 5:11 [Bug c++/51617] New: " dave at boostpro dot com 2011-12-19 5:58 ` [Bug c++/51617] " dave at boostpro dot com 2011-12-19 10:50 ` [Bug libstdc++/51617] " redi at gcc dot gnu.org 2011-12-19 10:52 ` redi at gcc dot gnu.org 2011-12-19 11:04 ` dave at boostpro dot com [this message] 2011-12-19 11:18 ` redi at gcc dot gnu.org 2012-02-05 20:32 ` redi at gcc dot gnu.org 2013-03-22 14:45 ` jakub at gcc dot gnu.org 2013-03-23 15:01 ` redi at gcc dot gnu.org 2014-04-22 11:36 ` jakub at gcc dot gnu.org 2014-07-16 13:29 ` jakub at gcc dot gnu.org 2014-07-16 14:19 ` redi at gcc dot gnu.org 2015-01-30 10:35 ` redi at gcc dot gnu.org 2015-04-27 13:38 ` torvald at gcc dot gnu.org 2015-05-05 1:57 ` redi at gcc dot gnu.org 2015-05-05 2:00 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-51617-4-R5FdzqdJJ5@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).