Answer the question
In order to leave comments, you need to log in
Finding and combining data by condition in ConcurrentQueue / Dictionary - how?
Greetings!
There is a dictionary that contains a key and a set of some string data.
IEnumerable<string> test1 = new List<string>()
{
"текст 1",
"текст 2",
"текст 3",
"текст 4",
"текст 5"
};
IEnumerable<string> test2 = new List<string>()
{
"текст 01",
"текст 02",
"текст 03",
"текст 3",
"текст 4",
"текст 5"
};
IEnumerable<string> test3 = new List<string>()
{
"текст 1",
"текст 2",
"текст 3",
"текст 49870",
"текст 687"
};
IEnumerable<string> test4 = new List<string>()
{
"текст 01",
"текст 02",
"текст 03",
"текст 411",
"текст 611"
};
ConcurrentQueue<Dictionary<string, IEnumerable<string>>> pairs = new ConcurrentQueue<Dictionary<string, IEnumerable<string>>>();
pairs.Enqueue(new Dictionary<string, IEnumerable<string>> { { "ключ 1", test1 }});
pairs.Enqueue(new Dictionary<string, IEnumerable<string>> { { "ключ 2", test2 } });
pairs.Enqueue(new Dictionary<string, IEnumerable<string>> { { "ключ 3", test3 } });
pairs.Enqueue(new Dictionary<string, IEnumerable<string>> { { "ключ 4", test4 } });
Answer the question
In order to leave comments, you need to log in
let's first break down the syntax and the tag
.. then maybe we can get to itConcurrentQueue>> pairs = new ConcurrentQueue>>();
C
tag
If we are talking about a queue, then do not try to turn it inside out with fur. Its main purpose is the FIFO queue . That is, some processes crap in this queue, and some others are sorted out of it in order of receipt . The closest example is a pharmacy with an "electronic queue": several terminals are placed near each entrance, where a check with a number is printed at an arbitrary moment by pressing a button. And then with this number a scoreboard is displayed above one of the free windows ...
And if you really get something synthetic, then from dictionaries, lists, etc. with the prefix Concurrent or without.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question