Skip to content

Implement precise pthread wakeups#26659

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:precise_wakeups
Apr 14, 2026
Merged

Implement precise pthread wakeups#26659
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:precise_wakeups

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Apr 9, 2026

This change implements the design in docs/design/01-precise-futex-wakeups.md.

As part of this change emscripten_futex_wait API now explicitly allows spurious wakeups, much like the corresponding linux syscall. There were a couple of tests that were using emscripten_futex_wait without a loop, so I added loops to them in an abundance of caution.

I also rolled the posixtestsuite submodule so that in now includes emscripten-core/posixtestsuite#12, which was needed because that test becoming more flaky with this change.

Fixes: #26633

@sbc100 sbc100 force-pushed the precise_wakeups branch 3 times, most recently from 61f016e to 20d6937 Compare April 9, 2026 16:56
@sbc100 sbc100 requested a review from tlively April 9, 2026 16:56
@tlively
Copy link
Copy Markdown
Member

tlively commented Apr 9, 2026

"implemenat" => "implements" in description.

@sbc100 sbc100 force-pushed the precise_wakeups branch 3 times, most recently from cb1c872 to 8dc3c30 Compare April 11, 2026 00:49
@sbc100 sbc100 requested a review from tlively April 11, 2026 00:50
@sbc100 sbc100 force-pushed the precise_wakeups branch 2 times, most recently from 323fe09 to 0d4e436 Compare April 11, 2026 16:03
@sbc100 sbc100 requested a review from tlively April 11, 2026 16:04
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % a few more typos.

This change implements the design in docs/design/01-precise-futex-wakeups.md

Note: As part of this change the definition of emscripten_futex_wait
was changes to explicitly allow spurious wakeups.

Fixes: emscripten-core#26633
@sbc100 sbc100 enabled auto-merge (squash) April 14, 2026 23:34
@sbc100 sbc100 merged commit 3281561 into emscripten-core:main Apr 14, 2026
27 checks passed
@sbc100 sbc100 deleted the precise_wakeups branch April 14, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can we avoid continuous wakeups in emscripten_futex_wait?

2 participants