Tuesday, September 2, 2014

C# Threading

  1. Lock
  2. Monitor.Enter and Monitor.Exit
  3. Mutex is like a C# lock, but it can work across multiple processes
  4. A semaphore is like a nightclub: it has a certain capacity, enforced by a bouncer. Once it’s full, no more people can enter, and a queue builds up outside.
"A class is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination on the part of the calling code."

A program or method is thread-safe if it has no indeterminacy in the face of any multithreading scenario.

 Assemblies can be shared among multiple applications on the machine by registering them in global Assembly cache(GAC). GAC is a machine wide a local cache of assemblies maintained by the .NET Framework. We can register the assembly to global assembly cache by using gacutil command.
We can Navigate to the GAC directory, C:\winnt\Assembly in explore. In the tools menu select the cache properties; in the windows displayed you can set the memory limit in MB used by the GAC

Attributes allow you to add descriptions to classes, properties, and methods at design time that can then be examined at runtime via reflection.

No comments:

Post a Comment