C# 7 and .NET Core 2.0 High Performance
上QQ阅读APP看书,第一时间看更新

Multithreading in .NET Core

There are many benefits in using multithreading in CPU and/or I/O-bound applications. It is often used for long-running processes that have a longer or infinite lifetime, working as background tasks, keeping the main thread available in order to manage or handle user requests. However, unnecessary use may completely degrade the application's performance. There are cases where creating too many threads is not a good architecture practice.

Here are some examples where multithreading is a good fit:

  • I/O operations
  • Running long-running background tasks
  • Database operations
  • Communicating over a network