cameron314 / cameron314/concurrentqueue

ImplicitProducer try_enqueue in multi thread may not act as expected

Open
#429 1 comment 0 reactions 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

By default, a queue can store 1024 items. However, when multiple threads insert data into the same queue under the ImplicitProducer mode, switching between producers causes try_enqueue to fail before reaching 1024 items.

The reason is that after switching producers, try_get_block_from_initial_pool is called again, resulting in each block storing fewer than 32 items before switching occurs.

​Is this an issue or expected behavior?​​

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

Start by reproducing the multi-threaded ImplicitProducer case described in the issue, then inspect try_get_block_from_initial_pool and the surrounding producer-switching behavior. A useful outcome is a confirmed determination of whether try_enqueue failing before 1024 items is expected, with the behavior documented or a focused change identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.