Brian McCutchon <[email protected]> added the comment:
I understand your hesitation to add a fake. Would it be better to make it
possible to subclass Executor so that a third party implementation of this can
be developed?
As for an example, here is an example of nondeterminism when using a
ThreadPoolExecutor with a single worker. It sometimes prints "False" and
sometimes "True" on my machine.
from concurrent import futures
import time
complete = False
def complete_eventually():
global complete
for _ in range(150000):
pass
complete = True
with futures.ThreadPoolExecutor(max_workers=1) as pool:
pool.submit(complete_eventually)
print(complete)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36395>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com