Jump to content

Mutex: Difference between revisions

68 bytes added ,  15 years ago
m
Race condition link
(Created)
 
m (Race condition link)
Line 3:
'''Mutex''' (''abbreviated'' '''Mut'''ually '''Ex'''clusive access) is a synchronization object, a variant of [[semaphore]] with ''k''=1. Mutex is said to be seized by a [[task]] decreasing ''k''. It is released when the task restores ''k''. Mutexes are typically used to protect a shared resource from concurrent access. A [[task]] seizes the mutex, then accesses the resource, and after that releases the mutex.
 
Mutex is a low-level synchronization primitive exposed to deadlocking. A deadlock can be constructed already with two tasks and two mutexes. Entering the deadlock is usually aggravated by a [[race condition]] state, which leads to sporadic hangups, very difficult to track down.
 
==Variants of mutexes==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.