Skip to content

Improve push lock wakeup behavior under contention - #38

Merged
Mathewnd merged 1 commit into
Mathewnd:rewritefrom
wnsntgs:pushlock
Sep 11, 2026
Merged

Improve push lock wakeup behavior under contention#38
Mathewnd merged 1 commit into
Mathewnd:rewritefrom
wnsntgs:pushlock

Conversation

@wnsntgs

@wnsntgs wnsntgs commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

The current implementation doesn't record whether a waiter requested shared or exclusive ownership, so every release wakes only one waiter. As a result, shared waiters queued behind an exclusive owner are effectively serialized.

This change records waiter mode and wakes the waiter chain when the oldest waiter is shared, while preserving retry-after-wake semantics. Also removes hard coded push lock masks/alignment values.

Queued 4 reader case:

  • before: max-active=1, ~83 ms
  • after: max-active=4, ~21-22 ms

@Mathewnd
Mathewnd merged commit 565c997 into Mathewnd:rewrite Sep 11, 2026
@Mathewnd

Copy link
Copy Markdown
Owner

Thanks for the PR! Sorry it took this long to review, I was quite focused on getting wi-fi to work in Astral (I am giving a talk about Astral next month and I want to talk about the wi-fi stack in it)

@wnsntgs
wnsntgs deleted the pushlock branch September 11, 2026 06: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.

2 participants