Answer the question
In order to leave comments, you need to log in
Why are some numbers skipped when trying to implement multithreading?
Explain, I wanted to multithread, but in the end it skips some ranges, skips, and even freezes from 1000 threads, + why different threads take the next digit one by one, but although it was planned to divide into several small ones
https://github.com/sdigi/VkDockSearch /blob/dev/VKD...
Answer the question
In order to leave comments, you need to log in
for (int i = 0; i < taskCount; i++)
{
Thread thread = new Thread(ParsingDocUserIdAync);
p[1] = docStarId;
p[2] += (int)offset;
thread.Start(param);
docStarId = p[2]+1;
list.Add(thread);
}
p
and param
are the same object). thread.Start(param)
does not guarantee that the thread will be created and start executing immediately.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question