I know that threading.Lock()
is equal to threading.Semaphore(1)
.
Is also threading.Lock()
equal to threading.BoundedSemaphore(1)
?
And newly I saw threading.BoundedSemaphore()
, what is the difference between them? For example in the following code snippet (applying limitation on threads):
import threading
sem = threading.Semaphore(5)
sem = threading.BoundedSemaphore(5)