Blocks :
|
|
Blocks :
|
|
Relates :
|
The mutex ranking is used as a deadlock prevention technique that assigns a rank to each Mutex. Mutexes have to be acquired in order of decreasing rank which prevents circular waits. Today we validate this order everytime we acquire ownership of a Mutex. We could relax this validation for try_lock() in cases where failure to acquire ownership will not block the thread's progress, i.e. in cases where the action under the lock is desirable but can be skipped on try_lock() failure. In these cases, even if the Mutex is out of rank order the thread will not block if it already has an owner, so circular waits are not possible.
|