fix(libkernel): use precise waits for empty poll sets #4980
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4980"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:11:33Z.
What
When
poll_nid_postfixhas no native sockets or pipes and a positive timeout, it currently callsstd::this_thread::sleep_for(std::chrono::milliseconds(timeout)). On Windows,sleep_for(1 ms)can take about 15.6 ms because the timed wait follows coarseGetTickCount64steps, as documented and measured in issue #1471.Use the existing
PreciseSleepUshelper for this empty-set wait, converting the guest timeout from milliseconds to microseconds. Add a repeated 1 ms empty-poll timing check toguest_pollso the coarse 15.6 ms behavior fails the test. This carries only thepollportion of Doston Abdullayev’s public fix branch and preserves his original commit authorship. Theselectportion is covered separately by #4754.Tested
guest_poll_testsandlibkernel.prx;ctest -R '^guest_poll$' --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.git diff --check: passed.guest_pollruns reported on #1471. This branch was not independently built on Windows.Checklist
main; no equivalent open PR implements the empty-setpolltimeout fixpoll_nid_postfixfunction; merge/rebase after it)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T09:16:27Z.
Windows counter-test: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, this PR merged onto
main2a2a3dc65.guest_pollpasses with the PR; with the PR's source files replaced bymain's, same test, it aborts (0xc0000409).Not tested: Linux, a console, a title run.
AI-assisted (Claude Code).