You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case is that I have one function which will enqueue data in the queue & I have multiple threads which will dequeue & use this data at the same time one by one.
Is it possible with concurrent queue by only using single queue ?
The issue is if first thread dequeue's a data element from the queue then that data element will no more be available in the queue so how the other threads will dequeue same data element & use it?
So is there any way that only one dequeue operation happens between all the threads?
Or else any other way to resolve this using concurrent queue please suggest.
I have gone through sample examples but didn't find any example which fits my use case. So writing here, please provide your input.
The text was updated successfully, but these errors were encountered:
I saw that concurrent queue supports multiple consumers so if we assume each thread to be a consumer .
Then is there any possibility that multiple consumer(threads) consume same data from the same queue?
If not then what is the exact benefit of multiple consumers ?
My use case is that I have one function which will enqueue data in the queue & I have multiple threads which will dequeue & use this data at the same time one by one.
Is it possible with concurrent queue by only using single queue ?
The issue is if first thread dequeue's a data element from the queue then that data element will no more be available in the queue so how the other threads will dequeue same data element & use it?
So is there any way that only one dequeue operation happens between all the threads?
Or else any other way to resolve this using concurrent queue please suggest.
I have gone through sample examples but didn't find any example which fits my use case. So writing here, please provide your input.
The text was updated successfully, but these errors were encountered: