Skip to content

Sequential Dispatcher#2854

Merged
djspiewak merged 9 commits intotypelevel:series/3.xfrom
djspiewak:feature/spsc-dispatcher
Apr 26, 2022
Merged

Sequential Dispatcher#2854
djspiewak merged 9 commits intotypelevel:series/3.xfrom
djspiewak:feature/spsc-dispatcher

Conversation

@djspiewak
Copy link
Copy Markdown
Member

This is a little less of an SPSC Dispatcher and more MPSC, and definitively a lot more about "short actions that you want to be sequential". Basically this special-cases just a bit for the q.offer case, which is obviously quite common in practice. Haven't added benchmarks back, but anecdotally from test runs this appears to be around a 1-2 order of magnitude improvement in those cases.

Closes #2768

@djspiewak djspiewak changed the title Sequential Dispatcher Sequential Dispatcher Mar 1, 2022
Copy link
Copy Markdown
Member

@vasilmkd vasilmkd left a comment

Choose a reason for hiding this comment

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

Nice and clean. Only the one question.

@djspiewak
Copy link
Copy Markdown
Member Author

So one immediate problem with doing away with the ADT is it means we can't support Dispatcher#mode. Maybe that's a non-issue though? How much do we feel like people are going to need to runtime-introspect their dispatchers and case on their modality?

@armanbilge
Copy link
Copy Markdown
Member

TBH I hadn't considered allowing introspection at all. When I need a dispatcher, I usually create exactly what I need on-the-spot, instead of asking someone else to give it to me?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Dispatcher to be configured for single-producer scenarios

4 participants