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

Question : for this scene, a single-producer, multi-consumer, and these consumer thread execute alternately. which lock-free queue should I use? #161

Open
yuzu-ogura opened this issue Oct 21, 2024 · 1 comment

Comments

@yuzu-ogura
Copy link

yuzu-ogura commented Oct 21, 2024

Hello, I have this scene: a single-producer, multi-consumer, and these consumer thread execute alternately. That is to say, only one consumer thread is using the queue at any time, which lock-free queue should I use?
A single-producer, single-consumer lock-free queue or a single-producer, multi-consumer lock-free queue

@cameron314
Copy link
Owner

You can use an SPSC implementation, provided you take care to synchronize the memory effects as the queue is handed off between threads.

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

No branches or pull requests

2 participants