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

Draft: Add peek to ArrayQueue<T> where T: Copy #1013

Closed
wants to merge 3 commits into from

Conversation

estk
Copy link

@estk estk commented Aug 10, 2023

Hi 👋 , I'm not sure if there is appetite in general for this feature but I personally found it useful. I would be happy to add the symmetric method to SegQueue as well. I noticed issue #30 but I figured it does not apply to this specialization. Also happy to just leave this be if it's not useful to anyone.

@estk
Copy link
Author

estk commented Aug 10, 2023

After reviewing the miri tests, i'm not convinced this can be done without UB or substantially revising the algo...

@estk estk closed this Aug 10, 2023
@estk
Copy link
Author

estk commented Aug 11, 2023

So after a bit of rework, I added a custom spinlock and was able to make miri happy locally. I'm skeptical if this is something that the crossbeam team will really be interested in since it requires an extra spinlock which will cause contention between .peek() and .push() operations. Nonetheless I would be interested in feedback.

@estk estk reopened this Aug 11, 2023
Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

I would prefer not to add spinlock here.

So I'm going to close this, but thanks anyway for the PR!

@taiki-e taiki-e closed this Aug 15, 2023
@estk
Copy link
Author

estk commented Aug 15, 2023

yep thanks for the consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants