In this video, we will be discussing in detail what is Mutex in Operating systems.
Mutex in Operating Systems:
Mutex is also known as Mutual Exclusion lock. Mutex is a variable that is set before accessing a shared resource and released after using the shared resource. When the mutex is set, the shared resource cannot be accessed by any other process or thread.
Mutex locks are used for process synchronization. Mutexes are used by Operating Systems to control the entry and exit of processes in Critical Sections. Assume a process has acquired mutex lock on a critical section.
If the scheduler decides to perform context switching, then all other processes that are ready to execute the same critical section, are unblocked. If the selected process tries to access the locked critical section, it will again be blocked because the mutex lock has not been released. Context switching will happen continuously but no process will be able to succeed in accessing the locked critical section. A mutex can be released only by the process that acquired it.
Mutex in Operating Systems:
https://www.geeksforgeeks.org/mutual-exclusion-in-synchronization//