Skip to content

feat: Add queuing strategies for listener lists. #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jevolk
Copy link

@jevolk jevolk commented Jun 26, 2025

Two strategies are available:

  • FIFO: The original round-robin queuing; listeners are inserted at the back.
  • LIFO: The new most-recent queuing; listeners are inserted at the front.

LIFO queuing is beneficial for cache-efficiency with workloads that are tolerant of starvation. The same listener is repeatedly drawn from the list until the load dictates additional listeners be drawn from the list. These listeners expand outward as a "hot set" for optimal reuse of resources rather than continuously drawing from the coldest resources in a FIFO schedule.

(Previously #149 but closed automatically when repository moved)

@taiki-e
Copy link
Collaborator

taiki-e commented Jul 26, 2025

Thanks for the PR. I haven't checked the implementation details, but in any case, there is no possibility of accepting a PR without any testing.

@jevolk
Copy link
Author

jevolk commented Jul 26, 2025

That seems like a good idea. I have added some now.

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Looks good to me! Please rebase on latest master.

Two strategies are available:
- FIFO: The original round-robin queuing; listeners are inserted at the back.
- LIFO: The new most-recent queuing; listeners are inserted at the front.

LIFO queuing is beneficial for cache-efficiency with workloads that are
tolerant of starvation. The same listener is repeatedly drawn from the list
until the load dictates additional listeners be drawn from the list. These
listeners expand outward as a "hot set" for optimal reuse of resources rather
than continuously drawing from the coldest resources in a FIFO schedule.

Signed-off-by: Jason Volk <[email protected]>
@notgull
Copy link
Member

notgull commented Aug 8, 2025

Looks like CI is failing now...

@jevolk
Copy link
Author

jevolk commented Aug 8, 2025 via email

@notgull
Copy link
Member

notgull commented Aug 9, 2025

No, just disable LIFO tests for no_std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants