Landing: 4b690722a058

Project / Subsystem

gcc / libstdc++

Date

2026-05-05

Author

Jonathan Wakely

Commit

4b690722a0585c50f033deec5637760a671c72f0

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
—
commit_hash
4b690722a0585c50f033deec5637760a671c72f0
source_type
github
headline
libstdc++: Use proper hash function for atomic::wait state [PR115955]
tldr
Improves std::atomic::wait performance and correctness by using a better hash function for wait state lookups.
author
Jonathan Wakely
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • libstdc++
  • • concurrency
  • • performance
  • • bugfix
discussion_id_link
—
bugzilla_pr
—
date
2026-05-05T00:00:00.000Z

The hash function used for managing wait states in std::atomic::wait has been improved to reduce collisions and pathological behavior. The previous hashing scheme led to frequent collisions, causing incorrect wakeups and performance degradation, especially under high thread contention. The new hash function provides better distribution and uses a per-process seed for increased uniqueness.