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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run a program in notepad ++?

594


What are proxy objects in c++?

639


What does int * mean in c++?

631


What is an incomplete type in c++?

762


What is iterator in c++?

608






What is the standard template library (stl)?

621


How one would use switch in a program?

611


What are different types of loops in c++?

652


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

787


What is the average salary of a c++ programmer?

534


Specify some guidelines that should be followed while overloading operators?

616


Evaulate: 22%5 a) 2 b) 4 c) 0

665


Which is most difficult programming language?

578


What are references in c++?

652


What is a flag in c++?

605