cameron314 / cameron314/concurrentqueue
How to force fully remove the remaining data.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.5k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I did my own statistics when using concurrentqueue, and occasionally there was a problem that the remaining data could not be taken out of the queue.
The detail is:
After no more data enqueue, a small amount of data will remain in the concurrentqueue and cannot be dequeue.
I use try_dequeue_bulk_from_producer() to do dequeue operation.
The reference log is as follows:
enqueue_count:6131058 dequeue_count:6131047 left:11
size_approx : 11
Because enqueue_count and dequeue_count are two variables respectively, and they are both accumulated by a single thread respectively. So the data is accurate.
And the num obtained by using size_approx() are also consistent.
Please tell me how to solve this situation. How to force fully remove the remaining data.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the reported case with try_dequeue_bulk_from_producer() after enqueueing stops, compare its result with size_approx(), and use the supplied enqueue/dequeue counts to investigate the remaining items. Done means identifying whether the behavior is expected or reproducible and documenting the resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 22/100