Contents tagged with Multi-Threading
-
Why and how to use lazy initialization in C# using Lazy<T> API
First of all, why do we need lazy object initialization? The answer is that when initialization of an object for whatever reason is expensive, we would typically wish to instantiate it once and only when it's required. There is an API introduced in .NET Framework called Lazy<T> for this purpose.
-
An introduction to BlockingCollection
BlockingCollection is a class under System.Collections.Concurrent namespace and as the name implies, like any other collections under this namespace, it can also be used in concurrent and multi-tasking scenarios.
-
How to set CurrentCulture for all threads in a domain in .NET 4.5
Before .NET 4.5 if we wanted to set CurrentCulture for the current thread, we would need to set the culture in somewhere like application bootstrap.