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
What is the use of ::(scope resolution operator)?
Can I make ios apps with c++?
How is computer programming useful in real life?
What is array in c++ example?
Refer to a name of class or function that is defined within a namespace?
What is jump statement in C++?
What is const pointer and const reference?
Explain stack & heap objects?
How are the features of c++ different from c?
What is encapsulation in c++?
What are virtual constructors/destructors?
What are the advantages of inheritance in c++?
Evaulate: 22%5 a) 2 b) 4 c) 0
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What does the linker do?