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: Queue implementation concurrency data hazard #63

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

ventZl
Copy link
Owner

@ventZl ventZl commented Feb 10, 2025

When the last item is read from the queue, then the status of the queue structure will briefly signalize that the queue is full instead of being empty. This is due to the fact that queue is inherently implemented as a lock-free structure.

Put empty flag update in front of the cursor update so this data hazard won't be ever visible from outside.

When the last item is read from the queue, then the status of the queue
structure will briefly signalize that the queue is full instead of being
empty. This is due to the fact that queue is inherently implemented as a
lock-free structure.

Put empty flag update in front of the cursor update so this data hazard
won't be ever visible from outside.
@ventZl ventZl merged commit 61e4c76 into master Feb 10, 2025
1 check passed
@ventZl ventZl deleted the fix/queue-data-hazard branch February 10, 2025 15: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.

1 participant