One quick thing before I forget this method. If there are multiple Tasks which are executing in parallel, how to yield the result from the first one to finish ?
It is simple as stack them into an array and waiting to until the first one to finish. Following is the coding.
It is simple as stack them into an array and waiting to until the first one to finish. Following is the coding.
Task tasks = {t1,t2,t3...}; // The Task Array int index = tasks.WaitAny(tasks); return tasks[index].Result;
No comments:
Post a Comment