dimanche 24 avril 2016

Difference between mutex and monitor

Let's set up the context: C++, Linux

I cannot get the difference between a mutex and monitor. I know, that monitor uses internally mutex but why we take care of? I know, that monitor provides condition_variable and it makes possible to inform waiting other threads but, after all mutex also provide it in fact.

(*) I mean, when make mutex.unlock then operating system will awake sleeping other threads on that mutex: "Hi, you can continue your job, mutex is free".

I highlight with * a part of my post becaue I am not sure if I reason correctly.(?)

Please help me

Aucun commentaire:

Enregistrer un commentaire