Just a quick question. I believe this is just a quick syntax question. Below I'm sending out 3 threads and for testing multi-threading I just have the methods returning an int, not using them for anything.
Now, I am trying to go further with this and return a datatable with each thread sent out. However, I obviously can't say 'datatable dt = tasks.Add(....etc.'
So how would I send out all 3 threads at the same time and get the 3 datatables returned to me? Would I use something other than an array?
Edit- I think I'm not explaining myself well I apologize. All I'm doing is each method( nrx.nzrxin, ni.nzinputins) returns a datatable. I just don't know the syntax for sending the method out in a thread. Usually you would do 'datatable dt = nrz.nzrxins'. How do you do that with a task?
Thanks,
NZInput NI = new NZInput();
NZOutput NO = new NZOutput();
NZRX NRX = new NZRX();
List<Task> tasks = new List<Task>(3);
tasks.Add(Task.Run(() => NRX.nzrxins()));
tasks.Add(Task.Run(() => NI.nzinputins()));
tasks.Add(Task.Run(() => NO.nzoutputins()));
Task.WaitAll(tasks.ToArray());