Is there any systematic tutorial that covers different ways of multithreading in C# and when to use them respectively (like patterns)?
Thanks.
There are many different ways of course but the difference between most of them comes down to preference.
I would say in 99% of the cases, Task
will be the most comfortable and easiest option, if you need more then just use List<Task>
or the better variant although not sorted, ConcurrentBag<Task>
which is also thread safe.
The other 1% is maybe when you need something more web related that will also be more customizable, for example DataFlow
and such…
To make your life easier, I would say learn how to use Task
`s to an advanced level, and then just learn other ways upon requirement, if you encounter something that is not solved easily by using Task
`s.
Thanks for your insights. Really appreciated.
Have a read of this: http://www.albahari.com/threading/
It may not be exactly what you’re looking for, but it covers most things and gives examples etc.
Thanks. Will look into it.