I need to constantly ping about 400 machines, and with this, in order for another functionality of the program to work. I write this:
Task<IPStatus> tstTask(Apteka apt) { return Task.Run(() => { return apt.ping(); }); } async void tstDispRes(DataGridView dvg, List<Apteka> list) { for (int i = 0; i < list.Count; i++) { dvg[4, list[i].numPrint].Value = await tstTask(list[i]); } } and after the timer I call
t2.Start(); t2.Interval = 1000; t2.Tick += (o, v) => { tstDispRes(dataGridView2, arrayOfApteka); }; Asynchronous, everything is fine, but how can I make this business multithreaded? I read that when creating a Task, it is entered into the thread pool and executed as if in a separate one, but for some reason this is not noticeable. Direct what to read. Thanks in advance.