Task.WaitAll method vs Parallel.Invoke method

EDIT as of this article from MSDN:

Both Parallel and Task are wrappers for ThreadPool. Parallel invoke also awaits until all tasks will be finished.

Related to your questions:

Using Task, Parallel or ThreadPool depends on the granularity of control you need to have on the execution of your parallel tasks. I’m personally got used to Task.Factory.StartNew(), but that’s a personal opinion. The same relates to ThreadPool.QueueUserWorkItem()

Additional Information: The first call to Parallel.Invoke() and Task.Factory.StartNew() might be slower due to internal initialization.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)