Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Hi can anyone explain about the synchronization objects
types and where we are using in the code.



Hi can anyone explain about the synchronization objects types and where we are using in the code...

Answer / nishant

CRITICAL_SECTION :- CRITICAL_SECTION (CS) objects are initialized and deleted but do not have handles and are not shared by other processes. A variable should be declared to be of type CRITICAL_SECTION. Threads enter and leave a CS, and only one thread at a time can be in a specific CS. EnterCriticalSection blocks a thread if another thread is in the section. The waiting thread unblocks when another thread executes LeaveCriticalSection. If a thread already owns the CS, it can enter again without blocking; that is, CRITICAL_SECTIONs are recursive. CRITICAL_SECTIONs have the advantage of not being kernel objects and are maintained in user space. This usually, but not always, provides performance improvements.

Mutex: - mutexes can be named and have handles, they can also be used for interprocess synchronization between threads in separate processes. Mutex objects are similar to CSs, but, in addition to being process-sharable, mutexes allow time-out values and become signaled when abandoned by a terminating process.A thread gains mutex ownership (or locks the mutex) by waiting on the mutex handle (WaitForSingleObject or WaitForMultipleObjects), and it releases ownership with ReleaseMutex.

Semaphore :- Semaphores maintain a count, and the semaphore object is signaled when the count is greater than 0. The semaphore object is unsignaled when the count is 0.

Event :- Events are used to signal other threads that some event, such as a message being available, has occurred.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More MFC Interview Questions

what is the difference between SDI and MDI

15 Answers   CMC, HCL, Siemens,


What is model and modeless dialog box ? Give some examples?

2 Answers   Mphasis,


plzz tell me what we can do and dont in tally ERP & sap business one?

0 Answers  


What is userdefine Messages in MFC?

1 Answers   HCL,


Which MFC function is used to display output?

9 Answers   TCS,


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


What is the difference between workrer thread and UI thread

3 Answers   HCL,


how many types of messages are their

4 Answers   E Logic, TCS,


What is the use of message map ?

5 Answers   TCS,


List out the basic features of MFC.

4 Answers   Mphasis,


What is subclassing?

2 Answers  


Name the Synchronization objects?

2 Answers  


Categories