Earlier, we said that the need for synchronization arises even in the simple case of assigning or incrementing a field . Although locking can always satisfy this need, a contended lock means that a thread must block , suffering the overhead of a context switch and the latency of being descheduled, which can be undesirable in highly concurrent and performance-critical scenarios. The .NET Framework’s nonblocking synchronization constructs can perform simple operations without ever blocking, pausing, or waiting.
SQL UNION combines two separate SQL queries into one result set. A JOIN statement adds additional table columns to a result set (horizontally), UNION combines row results from one table with rows of another table (vertically). In order to perform a UNION the columns of table 1 must match those of table 2.
Factory Method pattern should be used when: - a framework delegate the creation of objects derived from a common superclass to the factory - the base factory class does not know what concrete classes will be required to create - delegates to its subclasses the creation of concrete objects - factory subclasses subclasses are aware of the concrete classes that must be instantiated
This document may be read as a guide to writing robust and reliable programs. It focuses on programs written in C#, but many of the rules and principles are useful even if you write in another programming language. 2.1 C# Sourcefiles