What's the difference between semaphore , critical sections and mutex?

Answer Posted / rajji

Semaphore and mutex are the synchronising mechanisms for shared resources. And critical region is part of synchonizing schemes, means it's a part of process sections.

Normally every process will have 3 sections 1.Entry section 2.critical section 3. exit section

In these critical section is more important which tells us how to manage resources like.
In semaphores if one thread is waiting for resource then other thread which has the resource can signal the waiting thread.
In Mutex if one thead is waiting for resource then it has to wait till resource get released. This is the best mechanism for multithreading.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I know if my cpu is overheating?

533


What are numerous ways in which a thread can enter the waiting state?

546


Can I use ie with google chrome?

511


How does a ram function?

597


Explain briefly about assembler and its functioning?

564






why is the context switch overhead of a user-level threading as compared to the overhead for processes? Explain.

592


What is Page-Stealer process?

769


Define multics?

596


What is the difference between exclusive lock and shared lock?

588


How do I know when chkdsk is done?

515


What is cpu scheduler?

594


What is starvation in operating system?

634


What is raid? What are the different raid levels?

551


Tell something about deadlock and how can we prevent dead lock?

607


What is feram?

591