'Python threading underlying implementation for Lock is mutex or spinlock
Ok, so I am bit confused about locks in python3
Or maybe my naivety in this area is the source of confusion :(
The threading module talks about Lock and says that acquire will block unless the lock is released. There is no mention of mutex or spinlock
And when I try to learn about locks in general, I come across mutex and spinlock in pthread which says that a mutex will put the thread is waiting state but spinlock will keep it busy
And threading documentation says that any thread can release the Lock which is not generally the case with pthread :)
So in python, the Lock is a just a mutex ? Or we have spinlocks in python ?
Came across this question, which I frankly didn't understand, but the person says that python is holding spinlock
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
