Message211046
> Are you sure? I didn't see the daemon flag in ThreadPoolExecutor.
Oh you're right, ThreadPoolExecutor does create daemon threads:
class ThreadPoolExecutor(_base.Executor):
...
def _adjust_thread_count(self):
# When the executor gets lost, the weakref callback will wake up
# the worker threads.
def weakref_cb(_, q=self._work_queue):
q.put(None)
# TODO(bquinlan): Should avoid creating new threads if there are more
# idle threads than items in the work queue.
if len(self._threads) < self._max_workers:
t = threading.Thread(target=_worker,
args=(weakref.ref(self, weakref_cb),
self._work_queue))
t.daemon = True <======= HERE
t.start()
self._threads.add(t)
_threads_queues[t] = self._work_queue |
|
Date |
User |
Action |
Args |
2014-02-12 00:00:15 | vstinner | set | recipients:
+ vstinner, gvanrossum, pitrou, neologix, serhiy.storchaka |
2014-02-12 00:00:15 | vstinner | set | messageid: <1392163215.36.0.212581045415.issue20526@psf.upfronthosting.co.za> |
2014-02-12 00:00:15 | vstinner | link | issue20526 messages |
2014-02-12 00:00:14 | vstinner | create | |
|