[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-07 Thread Gregory P. Smith

Gregory P. Smith added the comment:

cleaned up a bit with documentation added and submitted.  thanks.  
ThreadPoolExecutor threads now have a default name as well, because why not.

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-07 Thread Roundup Robot

Roundup Robot added the comment:

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

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-07 Thread Gregory P. Smith

Gregory P. Smith added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-01 Thread Zachary Ware

Changes by Zachary Ware :


--
stage:  -> patch review
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-01 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27664] Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor

2016-08-01 Thread Augie Fackler

New submission from Augie Fackler:

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.

--
components: Library (Lib)
files: cpython.patch
keywords: patch
messages: 271790
nosy: durin42
priority: normal
severity: normal
status: open
title: Allow specifying prefix for thread name in 
concurrent.futures.ThreadPoolExecutor
type: enhancement
Added file: http://bugs.python.org/file43967/cpython.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com