Hello, previously created a topic on the problem, but then I did not know what exactly is wrong. At the moment, I found out what the problem is, the threads in the method are created several times with the same parameters.
for (int t = 0; t <= tCount - 1; t++) { new Thread(() => { int id = t; bool DoMain = true; int c = int.Parse(arr.GetValue(0, t - 1).ToString()), c_ = int.Parse(arr.GetValue(1, t - 1).ToString()); string fw = null, model = null, type = null, link = null; int size = 0; int a_thread = a, b_thread = b; Task<bool> tryget = null; int f = 1; Console.WriteLine("CREATE THREAD " + id + " WITH PARAMS : C = " + c + " C_ = " + c_); while (DoMain) { try { iterCount.Invoke(new Action(() => { iterCount.Text = string.Format("Количество итераций : {0}", ++iCount); })); } catch { Console.WriteLine("ERROR ON 154"); } { link = string.Format("http://update.hicloud.com:8180/TDS/data/files/p3/s15/G{0}/g{1}/v{2}/f{3}/full/changelog.xml", a_thread, b_thread, c, f); //Console.WriteLine("THREAD " + id + " LINK " + link); tryget = TryGetV3(link); tryget.Wait(); if (tryget.Result) { fw = xmlGetModel(link); size = xmlGetSize(link); //============================Вносим данные в форму============================ try { foreach (string s in readModels) { if (fw.Contains(s)) { model = s; break; } } if (size > 1500000000) { type = "FULL"; } else { type = "OTA"; } dataGridView1.Invoke(new Action(() => { dataGridView1.Rows.Add(model, fw, type, link, "Download", a_thread, b_thread, c, f, id); })); firmwareCount.Invoke(new Action(() => { firmwareCount.Text = string.Format("Найдено прошивок : {0}", dataGridView1.Rows.Count); })); } catch { Console.WriteLine("ERROR ON 188"); } } link = null; } try { File.AppendAllText(filePath, string.Format(@"{0},{1},{2},{3},{4},{5}", dataGridView1.Rows[5].Cells[dataGridView1.Columns.Count].Value.ToString(), dataGridView1.Rows[6].Cells[dataGridView1.Columns.Count].Value.ToString(), dataGridView1.Rows[7].Cells[dataGridView1.Columns.Count].Value.ToString(), dataGridView1.Rows[8].Cells[dataGridView1.Columns.Count].Value.ToString(), dataGridView1.Rows[1].Cells[dataGridView1.Columns.Count].Value.ToString(), dataGridView1.Rows[9].Cells[dataGridView1.Columns.Count].Value.ToString()) + Environment.NewLine); } catch { } //FOR V LOOP ++c; if (c < c_) DoMain = true; else DoMain = false; fw = null; model = null; type = null; link = null; size = 0; tryget = null; } }){IsBackground = true}.Start(); } Print the line Console.WriteLine("CREATE THREAD " + id + " WITH PARAMS : C = " + c + " C_ = " + c_);
CREATE THREAD 7 WITH PARAMS : C = 47306 C_ = 47356 CREATE THREAD 7 WITH PARAMS : C = 47306 C_ = 47356 CREATE THREAD 7 WITH PARAMS : C = 47306 C_ = 47356 CREATE THREAD 7 WITH PARAMS : C = 47306 C_ = 47356 CREATE THREAD 7 WITH PARAMS : C = 47306 C_ = 47356 CREATE THREAD 8 WITH PARAMS : C = 47357 C_ = 47407 CREATE THREAD 8 WITH PARAMS : C = 47357 C_ = 47407 CREATE THREAD 8 WITH PARAMS : C = 47357 C_ = 47407 CREATE THREAD 11 WITH PARAMS : C = 47510 C_ = 47560 CREATE THREAD 11 WITH PARAMS : C = 47510 C_ = 47560 CREATE THREAD 11 WITH PARAMS : C = 47510 C_ = 47560 Those. several identical flows are created with the same parameters, why is this happening? How can you deal with this?