cameron314 / cameron314/concurrentqueue

Allocating producer objects in advance not knowing that threads will become producers?

Open
#326 3 comments 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

I would like to allocate memory up-front during initialization step of my application when worker threads have not been created yet.

Creating enough number of ProducerTokens and let each thread pick from it could be one solution but it needs object pool implementation and keeping per-thread, per-queue ProducerToken available to any code is cumbersome.

What could be the best approach to do it?

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 reviewing the ProducerToken usage and initialization assumptions described in the issue. Determine whether producer objects can be safely prepared before worker threads exist and what API or ownership model would be required. Done would require a documented, agreed approach; the issue does not name files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.