Intermediate
Python
Q82 / 101
What is the threading module's Lock versus RLock?
Correct! Well done.
Incorrect.
The correct answer is B) Lock is a simple mutex; RLock is re-entrant and can be acquired multiple times by the same thread
B
Correct Answer
Lock is a simple mutex; RLock is re-entrant and can be acquired multiple times by the same thread
Explanation
A regular Lock deadlocks if the same thread acquires it twice. RLock (Reentrant Lock) tracks the owning thread and a count, allowing the same thread to acquire it multiple times.
Progress
82/101