From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA56B395CC81; Thu, 14 May 2020 12:02:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA56B395CC81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589457771; bh=l/i3Jv1Gk9hv/8My1kwa7IRYpMcHLfUZ6NWHUbtrMQM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bTKcAvGPXfDM1IMdoMCbndd/8QI4lyGCtxOWhhXd/n4FnpgCCfTKmsIJgxKrEGk0Y CzCYVcd4MBZfd1wgXHHyaOYmX/GTVfxK+5g7zRk/kFuqns2uvK+ZMJc6p1uJzMM7pa j7LbV1XwJYViBPrF3Lksq3Q3+LI/X7LwS6EFby+w= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94087] std::random_device often fails when used from multiple threads Date: Thu, 14 May 2020 12:02:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 9.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 12:02:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94087 --- Comment #22 from Jonathan Wakely --- (In reply to rguenther@suse.de from comment #20) > Doh. OK, guess I'd set up the twister in all cases and make it=20 > programatically skip itself when rdrand/rdseed is available so we > could easily fall back to it. Not sure what extra state there is > that warrants the union, but well ... I suppose simply calling > random() from the C library isn't an option ;) Mersenne twister is just a bad choice, period. We could fit a linear_congruential_engine in the unused space of the union.=