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

What are the benefits of multithreaded programming?

658


What is multi programming?

561


Which one is not needed for multi-program environment?

559


Tell me when we browse internet system getting 500 error how will you solve the problem?

531


if thread a,b,c have Max,Min,Normal priorty what is N0. in below set they correspond to.Something like (2,0,1)

2206






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?

547


How do you kill a process using pid?

525


How do you taskkill a program?

539


Where is taskkill located?

548


Explain what is the impact if dns server fails?

540


Explain the difference between ntfs4 and ntfs5?

556


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?

529


What's difference between thread and process?

580


What's the difference in using runnable and extends in threads?

544


How do I kill a program without task manager?

525