-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
worse than locked queue #399
Comments
Hard to say why without sample code to investigate. |
That's a start. I see you're using integers. Are you using tokens? What sort of contention is there? |
Only a very few scenarios use integer |
For the non-integer types, do they have no-except move constructors? Are they being moved? Consider using producer and consumer tokens. I also encourage you to profile the code to see where the overhead is. |
I tried using this lock free queue in our program, but the performance of the task was even worse.
Our program scenario involves multiple queues, each with a fixed number of elements. After an element is retrieved by wait_dequeue, the program performs other operations and then enqueues the element. The purpose of this is to avoid repeatedly creating objects or to block threads in some scenarios to prevent too many threads from executing a logic at the same time
What I want to know is why the performance of this lock free queue is worse than the locked queue that our program already has
The text was updated successfully, but these errors were encountered: