Which one you will use to implement critical section?

Answer Posted / nirmalraj

Critical Section comes in single process environment they
didn't share accross process boundary.

In C if you wish to implement criticalsection you have to
use windows datastructure CRITICAL_SECTION and create a
object to access its members.

Initialize it
InitializeCriticalSection(&cs);
------------
-----------
function to call();
------------
DeleteCriticalSection(&cs);
.
.
call()
{
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to kill a particular process in windows?

522


Why thread is called as a lightweight process?

552


What is the reason for getting the dialogue box (send this error to microsoft giving options as send to microsoft and dont send) when we abort from the any workwhen it was struck?

541


What's difference between thread and process?

575


Can you explain too many times when I click on a sentence a caption comes on grr a pop up blocker maybe blockiing--however I have pushed the turn off pop upblocker. This only happens on google it does not happen on att.net?

523






How do we create threads?

551


What is thread safety and synchronization?

557


can any one know about NIC (National Informatics Centre) questions Patterns and full detail about written exam, and interview send to softshikha2005@yahoo.com.in Thank you

1570


How would you implement a thread pool?

534


Can you explain too many times when I click on a sentence a caption comes on grr a pop up blocker maybe blocking--however I have pushed the turn off pop up blocker. This only happens on google it does not happen on att.net?

587


Is kill ping a virus?

532


who among the following is responsible for establishing IS Audit function in the organisation?

1100


Explain how scheduling and priority works in threads?

526


What is the default kill signal?

529


How to share printer through ftp(fire transfer protocol)?

565