Skip to content
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

Introduced FixedArrayFIFOQueue #296

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

catap
Copy link
Contributor

@catap catap commented Apr 20, 2023

This is a copy of ArrayFIFOQueue which has fixed capacity.

I've also refactor a bit PriorityQueue interface to introduce a clear way to use exception free queue.

Throw an exception has two dissadvantages on very high load
application: (1) it flushes CPU caches, and (2) it allocates memory to
build a stack trace.

Here I've introduced a way to save tons of CPU time by allow user to
return excepted result (`null` for example) when queue is empty.
Right now one queue is implemented it, I just added it as official
interface to `PriorityQueue`.
This is a copy of `ArrayFIFOQueue` which has fixed capacity.
@catap
Copy link
Contributor Author

catap commented Apr 21, 2023

@vigna I've heavy rework this PR to use ArrayFIFOQueue as a base version. I've removed all councurency things which was originally here because it is too complex and probably useless. Synchronization for few operation is near of nothing, and better to suggest users to make simpler solution when they need it.

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.

None yet

1 participant