Working With Semaphore Class in C# and Best Practices
In this article, we'll introduce the semaphore class in C#. We'll compare the semaphore and semaphoreSlim classes and discuss the best practices for using semaphores. [sc name="github"...
Code Maze Author
MY ARTICLES:
In this article, we'll introduce the semaphore class in C#. We'll compare the semaphore and semaphoreSlim classes and discuss the best practices for using semaphores. [sc name="github"...
Due to the emerging significance of running background tasks, .NET Core has given us new ways of achieving it. BackgroundService is another tool in our toolbox with methods ExecuteAsync() and StartAsync() being the central components. In this article, we will compare...
The "using" directive in C# helps us reduce boilerplate code when referencing types and members that sit outside the context of our class. C# 12 further expanded on the using directive, allowing it to be used for additional types. In this article, we'll start by...
When working with JSON (JavaScript Object Notation) in .NET applications, developers often encounter challenges related to circular references, where objects circularly reference each other. In this article, we'll explore common scenarios involving circular...
Use await. It suspends the method and returns the thread to the pool while the operation runs, so the application keeps serving other work. When the task fails, the original exception surfaces where we can catch it. Task.Wait() blocks the calling thread until the task...