concept parallel operation in category .net

appears as: parallel operations, parallel operation, parallel operations
Concurrency in .NET

This is an excerpt from Manning's book Concurrency in .NET.

Despite the convenience of executing multiple tasks in parallel, Parallel.Invoke limits the control of the parallel operation because of the void signature type. This method doesn’t expose any resources to provide details regarding the status and outcome, either succeed or fail, of each individual task. Parallel.Invoke can either complete successfully or throw an exception in the form of an AggregateException instance. In the latter case, any exception that occurs during the execution is postponed and rethrown when all tasks have completed. In FP, exceptions are side effects that should be avoided. Therefore, FP provides a better mechanism to handle errors, a subject which will be covered in chapter 11.

The following example uses the F# MailboxProcessor as a perfect candidate to implement a DAG to run in parallel operations with dependencies. First, let’s define the discriminated union used to manage the tasks and run their dependencies.