Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Result result1 = null;
- Result result2 = null;
- var task1 = Task.Factory.StartNew(()=>
- {
- var records = DB.Read("..");
- //Do A lot
- result1 = Process(records);
- });
- var task2 = Task.Factory.StartNew(()=>
- {
- var records = DB.Read(".....");
- //Do A lot
- result2 = Process(records);
- });
- Task.WaitAll(task1, task2);
- var result = Combine(result1, result2);
- Result result1 = null;
- Result result2 = null;
- var task1 = await Task.Factory.StartNew( async ()=>
- {
- var records = await DB.ReadAsync("..");
- //Do A lot
- result1 = Process(records);
- });
- var task2 = await Task.Factory.StartNew(async ()=>
- {
- var records = await DB.ReadAsync(".....");
- //Do A lot
- result2 = Process(records);
- });
- Task.WaitAll(task1, task2);
- var result = Combine(result1, result2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement