Data Parallelism (TPL) and Task-based asynchronous programming (Task) in C# (and async await)

preview_player
Показать описание
Content:
1. Introduction: 0:00
2. Data Parallelism: 4:26
3. Sequential example: 9:24
4. Asynchronous programming (async await): 12:25
5. Asynchronous programming (async await) with Parallelism (Task-based): 18:04
6. CancellationToken: 23:42

Performance Test Result. The elapsed time for make 10 pizza:
- Sequential: 150 seconds.
- Sequential + asynchronous programming (async await): 50 seconds.
- Parallelism (Task) + asynchronous programming (async await): 15 seconds.

However, not all code is suitable for parallelization; for example, if a loop performs only a small amount of work on each iteration, or it doesn't run for many iterations, then the overhead of parallelization can cause the code to run more slowly. Furthermore, parallelization like any multithreaded code adds complexity to your program execution.

Although the Task Parallel Library (TPL) simplifies multithreaded scenarios, we recommend that you have a basic understanding of threading concepts, for example, locks, deadlocks, and race conditions, so that you can use the TPL effectively.

Please like and subscribe my channel if this video has helped you. Thank you :)
Рекомендации по теме
Комментарии
Автор

Ty for the great explanation Steve. It helped me a lot to understand difference between concurrency and parallelism. A big thumbs up.

jawwadsaeed
Автор

That was what i extremly needed thanks a lot pal

jacksonstevemartinez
join shbcf.ru