Skip to content

refactor: remove slab from waiter storage - #143

Open
tisonkun wants to merge 8 commits into
mainfrom
codex/remove-slab-waiter-lifecycle
Open

refactor: remove slab from waiter storage#143
tisonkun wants to merge 8 commits into
mainfrom
codex/remove-slab-waiter-lifecycle

Conversation

@tisonkun

@tisonkun tisonkun commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace the slab-backed waiter stores with a focused internal free-list arena
  • simplify WaitList to explicit head/tail links while retaining detached future-owned nodes until poll or drop
  • make wake-all registrations epoch-aware and unregister them when waiting futures are cancelled
  • reclaim queue-owned Semaphore::forget_exact debt nodes immediately after they are fulfilled
  • migrate FairShare to the same arena and remove mea’s only normal dependency

Waiter lifecycle

Future-owned semaphore and condition-variable waiters transition from linked to detached and are removed when their future observes completion or is dropped. Queue-owned permit debt is removed during the same operation that detaches it. WaitSet registrations carry an epoch so a stale registration cannot alias a slot reused after wake-all.

Validation

  • cargo x lint
  • cargo x test --no-capture
  • cargo x bench
  • cargo +1.85.0 test --workspace --no-default-features
  • cargo tree -p mea --edges normal

Replace slab-backed waiter state with a focused internal arena, make wait registrations generation-aware and cancellable, and reclaim queue-owned semaphore debt nodes as soon as they are fulfilled.
…ter-lifecycle

# Conflicts:
#	CHANGELOG.md
#	mea/Cargo.toml
…ter-lifecycle

# Conflicts:
#	mea/benches/primitives/semaphore.rs
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.

Deregister cancelled broadcast recv futures from WaitSet

1 participant