Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
vermeir_nico_introducing_net_6_getting_started_with_blazor_m.pdf
Скачиваний:
19
Добавлен:
26.06.2023
Размер:
11.64 Mб
Скачать

Chapter 11 Advanced .NET 6

Do not mistake WaitAsync with Wait. Wait is an actual blocking operation; it will block the thread until the Tasks completes and should only be used in very specific cases. WaitAsync is a way to add cancellation or timeout configuration to an asynchronous task that will run non-blocking.

Conclusion

.NET is an easy-to-use framework. It abstracts a lot of difficult concepts away from us as developers. While it does abstract these concepts away, we still have the possibility to dive deeper and actually use the more advanced concepts. We can get full control of the garbage collector and even implement our own garbage collectors should we really want to.

.NET 6 comes with big improvements on performance, on I/O-based operations, but also in general. Await/async is extended to give more fine-grained control to us developers; CancellationTokenSource is extended to allow more reuse of tokens. The examples in this chapter are just a few examples. There are some very good resources out there that dive deep into .NET.

•\

Async/Await - Best Practices in Asynchronous Programming -

 

https://docs.microsoft.com/en-us/archive/msdn-magazine/

 

2013/march/async-await-best-practices-in-asynchronous-

 

programming

•\

Pro .NET Memory Management - https://link.springer.com/

 

book/10.1007/978-1-4842-4027-4

•\

Task Parallel Library (TPL) - https://docs.microsoft.com/

 

en-us/dotnet/standard/parallel-programming/task-parallel-

 

library-tpl

311