Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async void f()
- {
- foreach (var item in childrenANDparents)
- {
- await Task.Run(() => SendUpdatedSiteInfo(item.Host,site_fr));
- // foreach loop does not work until the task return and continues
- }
- }
- public async void f()
- {
- foreach (var item in childrenANDparents)
- {
- Thread t = new Thread(() => SendUpdatedSiteInfo(item.Host, site_fr));
- t.Start();
- // foreach loop works regardless of the method, in debug mode it shows me
- // they are working in parallel
- }
- }
Add Comment
Please, Sign In to add comment