From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4BBD43858D39; Wed, 28 Sep 2022 22:18:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BBD43858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664403510; bh=AlRtDdwOKPVvEBHl/YAn/PUh8qiSNRgIO9kPhGu8m9E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N/sbuen71P/w6qdzj8fwuwuYUfyZOzqdMw0QyGvL0BctyNSgMTiPqZh0RD1zUqteQ G57ajWkSDZOYNgvy+YlZXYyk3ct3+G3cSFsSyO5sJaANYyUnV/wARDvMWgKeIioTtW ROJesjw6eqL5TdUz+hQ4dpZdUfteC5yDEPfqf0oU= From: "valera.mironow at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106772] atomic::wait shouldn't touch waiter pool if used platform wait Date: Wed, 28 Sep 2022 22:18:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valera.mironow at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106772 --- Comment #20 from Mkkt Bkkt --- My main concern with this optimization it's not zero-overhead. It's not necessary when we expect we have some waiters, in that case it just additional synchronization and contention in waiter pool (that have small f= ixed size, just imagine system with 100+ cores, if we have > 16 waiting threads = some of them make fetch_add/sub on the same atomic, that can be expensive, especially on numa) And at the same time, I don't understand when I need to notify and cannot k= now notification not needed. I don't understand when it useful.=