0

My purpose is to create queue sets for send data to each thread, assign queue's address to each thread, and then freely pass data to by queue

To do this, what kind of method or container I use? One of the plans I came up with was to deliver data through a vector that stored the address of the concurrent_queue or a linked list of connections.

ex)
std::vector<concurrency::concurrent_queue<int>*>
or
struct ptr_queue
{
    ptr_queue* pre_node;
    concurrency::concurrent_queue<int>* m_queue;
    ptr_queue* next_node;
};

But I had doubts about whether this was the best way and, about Is there really good way.

2
  • What sense in pass some object to each thread ? Exist sense pass this to arbitrary worked thread. Or make some data common for all threads, but this is not pass Commented Sep 1, 2021 at 10:07
  • 1
    From concurrency::concurrent_queue it looks like you're using the Microsoft concurrency runtime. If yes, it would help those that try to answer if you tagged the question as such and mention it in the description, because as phrased the question is very broad. Commented Sep 1, 2021 at 10:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.