Skip to content

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.

catap added 3 commits April 19, 2023 14:12
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.

@vigna vigna closed this Jun 21, 2025
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.

2 participants