Print Page | Close Window

Executing parallel task issue!

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4031
Printed Date: 03-May-2025 at 6:49pm


Topic: Executing parallel task issue!
Posted By: katit
Subject: Executing parallel task issue!
Date Posted: 12-Mar-2013 at 7:35pm
Migrating to 2012.. Didn't think it will be so much work with all the lambdas I have!

Anyway, I think I got a hang of async/await stuff and all is well except for parallel coroutines.

Documentation: http://drc.ideablade.com/devforce-2012/bin/view/Documentation/program-asynchronously

suggests I use "await Task.WhenAll(..)"

Silverlight doesn't have .WhenAll, only .WaitAll and it is not awaitable. When I try to do Task.WaitAll - I get lock issue..

Is there something I'm missing here?



Replies:
Posted By: kimj
Date Posted: 12-Mar-2013 at 7:49pm
In Silverlight you can await TaskEx.WhenAll.
 
The Compatibility library also includes Coroutines if you find converting all your code to DF2012 too much work for now.


Posted By: katit
Date Posted: 12-Mar-2013 at 7:58pm
Thanks for quick reply!

Yeah, I already started. Big task but I'd rather do it right. It is also learning async/await pattern in addition to migrating..


Posted By: mgood
Date Posted: 12-Mar-2013 at 9:07pm
There's also Cocktail's TaskFns class, which has platform independent implementations of WhenAll etc. in case you ever intend to share source code between platforms.

http://cocktail.ideablade.com/CocktailHelpReference/net45/Cocktail~Cocktail.TaskFns_members.html - http://cocktail.ideablade.com/CocktailHelpReference/net45/Cocktail~Cocktail.TaskFns_members.html




Print Page | Close Window