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

fix: thread starvation from non-constant time method call #502

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

My-Name-Is-Jeff
Copy link
Member

checking size/not empty on ConcurrentLinkedQueue is not constant time and requires either looping or grabbing first element

supersedes #501

outboundRoomQueue.clear()
printDevMessage("closed room queue world load", "dungeonws")
outboundRoomQueue.close()
outboundRoomQueueTask?.cancel()
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this does exactly what you expect it to since this will simply wait until it's fully finished executing before cancelling.

checking size/not empty on ConcurrentLinkedQueue is not constant time and requires either looping or grabbing first element
@My-Name-Is-Jeff My-Name-Is-Jeff merged commit 2b0cb7b into dev Oct 2, 2024
2 checks passed
@My-Name-Is-Jeff My-Name-Is-Jeff deleted the fix/wsstarve branch October 2, 2024 17:42
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