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...


Which one you will use to implement critical section?

Answers were Sorted based on User's Feedback



Which one you will use to implement critical section?..

Answer / 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

Which one you will use to implement critical section?..

Answer / svinto

Now sure what is asked but anyway:
1. If the question is how would you implement critical
section mechanism then the answer is to use a mutex.
2. If the question is to show how to use the critical
section then the following code fragment adresses that:
//
// Global variable or a member of some
// dynamically allocated structure, usualy within
// the data access to which it is protecting.
//
CRITICAL_SECTION cs;

VOID Init(VOID) {
InitializeCriticalSection( &cs );
}

VOID SomeCall(VOID) {
EnterCriticalSection( &cs );
//
// Thread-safe block of code protected by critical
section.
//
LeaveCriticalSection( &cs );
}

VOID
UnInit(VOID) {
DeleteCriticalSection( &cs );
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Windows Threads Interview Questions

Is kill ping a virus?

0 Answers  


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 up blocker. This only happens on google it does not happen on att.net

1 Answers  


In window Xp which are the threads.Actually i wanna know if Ms word is a process which are the threads?Is spell check is a thread? I wanna know in reality which are the threads do they have any name..?

1 Answers   RBI,


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

0 Answers  


What are the different identifier states of a thread?

0 Answers  


Explain thread.sleep?

0 Answers  


Tell me how to share printer through ftp(fire transfer protocol)?

0 Answers  


Which one you will use to implement critical section?

2 Answers   HCL,


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

0 Answers   NIC,


semaphore variable is different from ordinary variable by ?

2 Answers   Siemens,


What is thread safety?

0 Answers  


Explain cannot copy (file name)- access is denied?

0 Answers  


Categories