Message211046
| Author |
vstinner |
| Recipients |
gvanrossum, neologix, pitrou, serhiy.storchaka, vstinner |
| Date |
2014年02月12日.00:00:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1392163215.36.0.212581045415.issue20526@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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 |
|