GNOME Bugzilla – Bug 580505
add a way to set/get name for a thread
Last modified: 2011-10-03 15:58:15 UTC
Associating a name with threads is helpful when debugging multithreaded apps. linux + pthread: (not portable :/) http://www.heise.de/developer/foren/S-Re-Pthreads-einen-Namen-geben/forum-44546/msg-16039431/read/ win32: (its a big hack :/) http://blogs.msdn.com/stevejs/archive/2005/12/19/505815.aspx http://thetweaker.wordpress.com/2009/04/10/naming-threads/ does anyone know something better?
Miguel replied to me on stackoverflow about that: http://stackoverflow.com/questions/139859/setting-the-thread-proc-pid-cmdline/ :)
It seems portability would be quite quite hard to achieve here: For Win, it looks like it's only for MS Debuggers...
*** Bug 611911 has been marked as a duplicate of this bug. ***
*** Bug 654252 has been marked as a duplicate of this bug. ***
*** Bug 605173 has been marked as a duplicate of this bug. ***
Created attachment 197846 [details] [review] Allow giving names to threads These show up in 'info threads' in gdb (as well as in /proc/$PID/task/$TID/comm).
Review of attachment 197846 [details] [review]: nice abuse of retval... we could s/create/new/, which would give us a second try at the _full() API we could also introduce some sort of attributes structure (similar to what posix does)
(In reply to comment #7) > Review of attachment 197846 [details] [review]: > > nice abuse of retval... Yeah, I meant to add a comment about it somewhere. I also had some doubts about the memory management there; maybe we do need to copy that string after all... > we could s/create/new/, which would give us a second try at the _full() API That's an idea. > we could also introduce some sort of attributes structure (similar to what > posix does) Umm, the posix attribute stuff strikes me as clumsy at best. It is extensible, but that is about its only positive characteristic...
Has the patch been committed?