Skip to content

Implement precise pthread wakeups#26659

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:precise_wakeups
Open

Implement precise pthread wakeups#26659
sbc100 wants to merge 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.

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.

@sbc100 sbc100 force-pushed the precise_wakeups branch 2 times, most recently from e9a4dc9 to fc5985b Compare April 13, 2026 23:55
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
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