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


What is a mutex and a critical section.Whats difference
between them?How do each of them work?

Answers were Sorted based on User's Feedback



What is a mutex and a critical section.Whats difference between them?How do each of them work?..

Answer / prasenjit roy

Mutex is a locking object ( like a flag ) for avoiding the
simultaneous use of a common resource. It is also used to
lock the critical section.

Ctitical Section :: is a block of code which should run
atomically ie. there should be no contact switching while
this block executes and once the block starts it should
finish without any interruption.

Is This Answer Correct ?    10 Yes 0 No

What is a mutex and a critical section.Whats difference between them?How do each of them work?..

Answer / achal ubbott

Above answers are correct.now I tell why?
1. Critical Section Object works faster because Critical
section is a user object and is specific to a process.
Where as a Mutex is a kernel object and so many
processes running over the kernel can lock or
unlock/release it. So it is a bit heavier than Critical
Section and thus slow.
2. When control enters the critical section the interrupts
(from various devices like FEC, UART etc. ) to the CPU core
are disabled

Is This Answer Correct ?    7 Yes 0 No

What is a mutex and a critical section.Whats difference between them?How do each of them work?..

Answer / edward

Both of them are synchronization objects .Critical section
used for snychronization of threads in a same
process.Mutexs used for sybchronizating a threads in diff
process

Is This Answer Correct ?    7 Yes 2 No

What is a mutex and a critical section.Whats difference between them?How do each of them work?..

Answer / vikas

Both of them are synchronization objects.
Critical sections are used for intraprocess synchronization
while mutexes are required for interprocess
synchronization. The latter is much heavier in terms of
resources consumed.

Vikas
http://www.cppquestions.com

Is This Answer Correct ?    7 Yes 3 No

Post New Answer

More C++ General Interview Questions

Differentiate between a template class and class template?

1 Answers  


What is a "RTTI"?

6 Answers   HCL,


Do you know the use of vtable?

0 Answers  


What is the difference between #import and #include?

0 Answers  


What is const in c++?

0 Answers  


What is the best sorting algorithm, when there is a large amount of data, that cannot be fit in the main memory. ?

1 Answers   Yahoo,


Explain the term memory alignment?

0 Answers  


What is c++ stringstream?

0 Answers  


Write some differences between an external iterator and an internal iterator?

0 Answers  


What is Pure Virtual Function? Why and when it is used ?

10 Answers   Lucent, Sona,


structure contains int, char, float how it behaves for big endian and little endian?

1 Answers   BITS,


what is data abstraction in C++?

0 Answers  


Categories