The six Multi-threaded classes provided with MFC fall into two categories.
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,
Source:MSDN
- Synchronization objects and
- 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".
- 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