c# - UWP Concurrent Threads -
so converting library uwp creates multiple threads run concurrently , grabs data of them @ end. have been looking in await , async task. believe going make class returns task<mytype> data need.
i wondering if there way inside uwp let of these instances of function run concurrently instead of using await , waiting each individual instance finish before starting next.
thanks much!
one approach wrap each task task, run them created, , wait on of them @ end.
some sample code:
var tasks = new list<task>(); var task1 = task.run(() => fetchdata1()); tasks.add(task1); var task2 = task.run(() => fetchdata2()); tasks.add(task2); task.waitall(tasks.toarray());
Comments
Post a Comment