Question d’entretien chez RT-RK

What is the difference between semaphore and mutex ?

Réponse à la question d'entretien

Utilisateur anonyme

23 mars 2019

Mutex is a special semaphore (or rather, semaphore is a generalized mutex). While the semaphore allows lock count to be any integer (blocking on reaching zero), mutex lock count is always 1. Similar very useful notions are barriers and conditional variables.