Issue27664
Created on 2016-08-01 18:03 by durin42, last changed 2016-08-07 17:20 by gregory.p.smith. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| cpython.patch | durin42, 2016-08-01 18:03 | Initial patch. | review | |
| Messages (4) | |||
|---|---|---|---|
| msg271790 - (view) | Author: Augie Fackler (durin42) * | Date: 2016-08-01 18:03 | |
This is mostly useful for when you've got a large number of threads and want to try and identify what threadpool is going nuts. |
|||
| msg272125 - (view) | Author: Gregory P. Smith (gregory.p.smith) * | Date: 2016-08-07 17:12 | |
A workaround for this on 3.5 and older versions is probably to do: initialization: num_q = queue.Queue() map(num_q.put, range(max_workers)) Then schedule max_workers identical tasks: def task(): threading.current_thread().name = '%s_%d' % (your_prefix, num_q.get()) num_q.task_done() num_q.join() # block so that this thread cannot take a new thread naming task until all other tasks are complete. guaranteeing we are executed once per max_workers threads. |
|||
| msg272126 - (view) | Author: Roundup Robot (python-dev) | Date: 2016-08-07 17:19 | |
New changeset 1002a1bdc5b1 by Gregory P. Smith in branch 'default': Issue #27664: Add to concurrent.futures.thread.ThreadPoolExecutor() https://hg.python.org/cpython/rev/1002a1bdc5b1 |
|||
| msg272127 - (view) | Author: Gregory P. Smith (gregory.p.smith) * | Date: 2016-08-07 17:20 | |
cleaned up a bit with documentation added and submitted. thanks. ThreadPoolExecutor threads now have a default name as well, because why not. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2016-08-07 17:20:38 | gregory.p.smith | set | status: open -> closed resolution: fixed messages: + msg272127 stage: patch review -> commit review |
| 2016-08-07 17:19:30 | python-dev | set | nosy:
+ python-dev messages: + msg272126 |
| 2016-08-07 17:12:51 | gregory.p.smith | set | messages: + msg272125 |
| 2016-08-01 18:18:13 | zach.ware | set | stage: patch review versions: + Python 3.6 |
| 2016-08-01 18:03:49 | gregory.p.smith | set | nosy:
+ gregory.p.smith |
| 2016-08-01 18:03:16 | durin42 | create | |