Skip to content

Conversation

jbaldwin
Copy link
Owner

lifo + fifo!

When setting a coro::event it is now possible to declare the order in which you want the waiters to be resumed. Default is lifo for performance but fifo can be picked at a runtime perf cost.

@jbaldwin jbaldwin added the enhancement New feature or request label Jul 26, 2021
@jbaldwin jbaldwin self-assigned this Jul 26, 2021
@jbaldwin jbaldwin linked an issue Jul 26, 2021 that may be closed by this pull request
Copy link

@niansa niansa left a comment

Choose a reason for hiding this comment

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

It might be better for performance to use seperate (templated) classes instead to decrease amount of branches but from what I have seen the code makes perfect sense.

@jbaldwin
Copy link
Owner Author

Yeah I started with it being templated version to remove the branch but then it doesn't compose as well across other usages in the library since it has two concrete types then. I might play around with it as a follow up to see how bad it cascades across everything but for now I'll get this merged so its available.

@jbaldwin jbaldwin merged commit 285416b into master Jul 26, 2021
@jbaldwin jbaldwin deleted the issue-97/event_policies branch July 26, 2021 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coro::event LIFO/FIFO policy
2 participants