Форум сайта python.su
Доброго времени суток, собственно проблема в использовании ThreadPoolExecutor из пакета concurrent.futures, именно в CentOS 6 при выполнении следующего кода:
from concurrent.futures import ThreadPoolExecutor, wait executor = ThreadPoolExecutor() futures = () for i in range(25): futures += executor.submit(lambda i=i: print(i)), wait(futures)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Traceback (most recent call last): File "thread.py", line 9, in <module> futures += executor.submit(lambda: print(i)), File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 115, in submit self._adjust_thread_count() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 134, in _adjust_thread_count t.start() File "/usr/local/lib/python3.6/threading.py", line 846, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't start new thread
Отредактировано triplustri (Янв. 21, 2017 02:03:49)
Офлайн
win8, ubuntu python 3.5 эффект не наблюдается.
Офлайн