Bug report
The below example completes in 6s for me with python2.7, but takes 21s for me in python3 . As of yet, I have not found any workaround to speed it up in python3.
import os, threading
lock = threading.Lock()
event = threading.Event()
def worker():
for ct in range(4000):
while not event.is_set():
event.wait(1)
with lock:
event.clear()
def test():
thread = threading.Thread(target=worker)
thread.start()
while thread.is_alive():
with lock:
event.set()
test()
Your environment
- CPython versions tested on:
- Operating system and architecture:
- Red Hat Enterprise Linux 7 x86_64
Bug report
The below example completes in 6s for me with python2.7, but takes 21s for me in python3 . As of yet, I have not found any workaround to speed it up in python3.
Your environment