In this chapter, we have learned about the synchronization primitives that are provided by .NET Core. Synchronized primitives are a must if you want to write parallel code and ensure that it is correct, even when multiple threads are working on it. Synchronization primitives come with performance overheads and the use of their slim counterparts is advised wherever possible.
We learned about signaling primitives as well, which can come in very handy when threads need to work on some external events. We also discussed the barrier and countdown events, which help us avoid code synchronization issues without the need to write additional logic. Finally, we introduced some spinning techniques, which take away performance overheads that arise from blocking code, that is, SpinLock and SpinWait.
In the next chapter, we will learn about the various data structures provided by .NET...