- Provide an example to show why using a singleton would not be a good mechanism for limiting access to a shared resource?
A singleton intentionally creates a bottleneck in an application. It is also one of the first patterns developers learn to use and, because of this, it is often used in situations where limiting access to the shared resource is not required.
- Is the following statement true? Why or why not? ConcurrentDictionary prevents items in the collection from being updated by more than one thread at a time.
For many C# developers, realizing that ConcurrentDictionary does not prevent items in the collection from being updated by more than one thread at a time is a painful lesson. ConcurrentDictionary protects a shared dictionary from being accessed and modified concurrently.
- What is a race condition...