How it works...

Because we are running all these threads in parallel, we can assume that the longest process will denote the total duration of all the tasks. This means that the total duration of the process will be 5 seconds because the longest task will take 5 seconds to complete (we set thread 3 to sleep for a maximum of 5 seconds).

As we can see, the time difference between the start and the end of Parallel.Invoke is exactly 5 seconds.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.79.241