This question may be subjective but i just want to know when to use TPL and when to use native thread based synchronization (evnts, wait handles).
Will the native thread synchronization techniques be obsolete going forward?
Thanks
Use TPL wherever you can because it's a cleaner, more declarative way to express your needs for parallelism.
MSDN explains "The TPL scales the degree of concurrency dynamically to most efficiently use all the processors that are available. In addition, the TPL handles the partitioning of the work, the scheduling of threads on the ThreadPool, cancellation support, state management, and other low-level details. By using TPL, you can maximize the performance of your code while focusing on the work that your program is designed to accomplish."
See also http://www.albahari.com/threading/part5.aspx which details the benefits of 'Data Parallelism' and other TPL benefits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With