Wednesday, July 2, 2014

Multi-threading : When to use synchronization classes.

The six Multi-threaded classes provided with MFC fall into two categories.
  1.     Synchronization objects and 
  2.     Synchronization access objects.

1.Synchronization classes are used when access to a resource must be controlled to ensure integrity of the resource.To determine which synchronization class you should use,

  • If the application have to wait for something to happen before it can access the resource use "CEvent".
  • If more than one thread within the same application access this resource at one time use "CSemaphore".
  • Can more than one application use this resource use "CMutex".
  • When a synchronization object that allows one thread at a time to access a resource use "CCriticalSection".
2. Synchronization access classes are used to gain access to these controlled resources.
  • If your application is concerned with accessing a single controlled resource only use "CSingleLock".
  • If your application needs to access to any one of a number of controlled resources use "CMultiLock".


Source:MSDN

String Table

A string table is a Windows resource that contains a list of IDs, values, and captions for all the strings of your application. For exa...