C# – Using ManualResetEventSlim and AutoResetEvent to signal waiting threads

In software development there are many ways to solve the same problem. It’s all about knowing what options are available and using the simplest approach for the job. When you want one or more threads to wait until they are signaled before continuing, how do you do it? There are many options that you can … Read more

ASP.NET – How to use a BackgroundService for long-running and periodic tasks

In ASP.NET, when you need a long-running background task, or need to run a task periodically, you can implement IHostedService or BackgroundService and register your class as a hosted service in Startup. As you may have already encountered, if you try to run a long-running background task, the web server will randomly kill your task … Read more