Repository navigation
fix(libc): avoid coarse Windows C++ condition waits - #7735
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
I checked the overlap bot's uncompared files manually. #1835, #5021, #6879 and #7201 each change the The rounded |
|
Windows run (Windows 11 build 26300, non-elevated, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
An earlier run today on Not covered: the full build, and any title run. |
|
Thanks for the controlled Windows comparison. The baseline test passes while the new timing assertion reproduces the coarse wait failure 3/3; with the PR it passes 5/5, and the measured medians drop from roughly 15.5–16.0 ms to roughly 1.5 ms. I’ll cite this as focused Windows validation and keep the full-build and title-run limitations explicit. |
|
Checked the Windows |
What
On Windows, route the Dinkumware
_Cnd_waitand_Cnd_timedwaitshim through native condition variables and aCRITICAL_SECTION, avoiding winpthreads'GetTickCount64timeout loop for C++ condition waits. Keep the existing standard-library path on POSIX. Timed waits round positive remaining durations up to milliseconds and recheck the absolute system-clock deadline after a timeout. The regression test measures the median of 31 one-millisecond waits with the same timer-resolution request used by AnyPS5.Related report: #1471 documents Windows
std::condition_variable::wait_untilovershooting by about 15.5 ms for a 1 ms timeout, whileSleepConditionVariableSRW(1)returned in 1.1–1.2 ms on the reported setup. This PR addresses the libc Dinkumware condition wait path only; it does not close the broader timing issue.Tested
Threads.cppandGuestLibcCndTimedWait.cpptogether with GCC 12.2 and ran the focused test successfully. This covers existing timed timeout, timed signal wake, untimed wake, and the unchanged POSIX implementation.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)