I was using CPython ,and found out that the wait() method of thread.Condition is very inefficient .
import datetime
import threading
cond = threading.Condition()
start = datetime.datetime.now()
for i in range(100):
with cond:
if cond.wait(timeout=0.0001):
pass
print((datetime.datetime.now() - start).total_seconds()/100)
It seems like cond.wait will always takes at least 0.01 second to proceed . Even if I set timeout as 0.0001 . I know GIL is inefficient ,but does it really takes that long ?