Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15500] Python should support naming threads

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 30, 2012, 5:19 AM

Post #1 of 13 (148 views)
Permalink
[issue15500] Python should support naming threads

New submission from Attila Nagy:

Python class Thread has a "name" argument, which sets the name of the given thread. This name is used only internally, while there is a possibility to set this on an OS-level.
Related discussion:
http://stackoverflow.com/questions/2369738/can-i-set-the-name-of-a-thread-in-pthreads-linux

#include <pthread.h>
int pthread_setname_np(pthread_t thread, const char *name);

// FreeBSD & OpenBSD: function name is slightly different
void pthread_set_name_np(pthread_t tid, const char *name);

// Mac OS X: it only seems applicable to the current thread (no thread ID)
int pthread_setname_np(const char*);

It would be very useful if Python set the name parameter with the above pthread calls, so the user/developer could see which threads do what in ps or top.

----------
components: Library (Lib)
messages: 166890
nosy: bra
priority: normal
severity: normal
status: open
title: Python should support naming threads
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 30, 2012, 11:28 AM

Post #2 of 13 (142 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by Antoine Pitrou <pitrou [at] free>:


----------
versions: +Python 3.4 -Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 30, 2012, 11:30 AM

Post #3 of 13 (141 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA [at] GMail>:


----------
nosy: +Arfrever

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 31, 2012, 5:40 PM

Post #4 of 13 (142 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by Jesús Cea Avión <jcea [at] jcea>:


----------
nosy: +jcea

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 1, 2012, 1:44 PM

Post #5 of 13 (138 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Christian Heimes added the comment:

+1

win32 supports thread names, too. http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 4, 2012, 1:13 PM

Post #6 of 13 (140 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by R. David Murray <rdmurray [at] bitdance>:


----------
nosy: +r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 4, 2012, 1:32 PM

Post #7 of 13 (140 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by Florent Xicluna <florent.xicluna [at] gmail>:


----------
nosy: +flox

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 4, 2012, 4:25 PM

Post #8 of 13 (135 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Antoine Pitrou added the comment:

I don't think this should be done by default as it will break people's expectations and, perhaps worse, compatibility.

----------
nosy: +pitrou

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 6, 2012, 3:22 AM

Post #9 of 13 (136 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Attila Nagy added the comment:

"I don't think this should be done by default as it will break people's expectations and, perhaps worse, compatibility."
I won't mind another thread naming API, if somebody does this. :)
But personally I expected python to name my threads (and if the OS supports it, on that level), I was actually surprised to see that it doesn't, mostly because I remembered a patch for FreeBSD, which did this years ago, so I thought it has been merged into mainline since then.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 6, 2012, 6:16 AM

Post #10 of 13 (140 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

R. David Murray added the comment:

It is indeed the compatibility that is the worse issue. The problem is what people have gotten used to and may have coded their applications to expect/deal with. what people have gotten used to. I agree with you that most people would *not* find it surprising to see the name reflect in the OS, but I don't think the convenience of that is worth introducing a potential backward incompatibility.

On the other hand, I think this might be an appropriate place to use a global control, so that getting thread names out to the OS would require adding just a single line of code to any given application. I know of an application that does this. It chose to implement it as a global change, and that makes sense to me.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 6, 2012, 6:16 AM

Post #11 of 13 (135 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by R. David Murray <rdmurray [at] bitdance>:


----------
Removed message: http://bugs.python.org/msg167559

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 6, 2012, 6:17 AM

Post #12 of 13 (134 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

R. David Murray added the comment:

It is indeed the compatibility that is the worse issue. The problem is what people have gotten used to and may have coded their applications to expect/deal with. I agree with you that most people would *not* find it surprising to see the name reflected in the OS, but I don't think the convenience of that is worth introducing a potential backward incompatibility.

On the other hand, I think this might be an appropriate place to use a global control, so that getting thread names out to the OS would require adding just a single line of code to any given application. I know of an application that does this. It chose to implement it as a global change, and that makes sense to me.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 7, 2012, 7:16 AM

Post #13 of 13 (114 views)
Permalink
[issue15500] Python should support naming threads [In reply to]

Changes by Andrew Svetlov <andrew.svetlov [at] gmail>:


----------
nosy: +asvetlov

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.