How do make a .NET 4 thread wait for asynchronous requests to finish?

I'm currently wrapping the asynchronous calls within a List of Task objects to use Tasks.WaitAll()

This is a fairly clean solution if you truly want to force these "tasks" to synchronize and block at this point. This is the main rationale behind Task.WaitAll(), and is nice since it (optionally) allows you to cancel the blocking operation after a timeout, if you so choose.

Comments

Popular posts from this blog

Delete Confirmation for Delete ButtonField, TemplateField and CommandField in a GridView in ASP.NET

Selecting/Deselecting all CheckBoxes inside a ListView In ASP.NET

How to Create 3 Tier Vb.Net Desktop Application