cameron314 / cameron314/concurrentqueue

How to force fully remove the remaining data.

Open
#361 4 comments 1 reaction 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.