GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-59705: Export threading.Thread() names to the OS by ZackerySpytz · Pull Request #14578 · python/cpython Conversation
|
|
Unfortunately, the string passed to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Will this ever happen?! The Issue has this year the 10th anniversary. In the Issue @eryksun also provides Code for Windows... so let this happen. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if _HAVE_THREAD_NATIVE_ID: | ||
| self._set_native_id() | ||
| if _HAVE_SET_THREAD_NAME: | ||
| _set_thread_name(self.name) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This should probably be more sophisticated, e.g. f"{sys.executable} [thread {self.name!r}]"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't work well for platforms with the 16-character limitation.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I would expect to see some changes to the Docs, how use, and if any affect on whats out there running now. Probably need to add version changed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This needs tests, which in turn will need a getter function -- at least a private one.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| int ret = 0; | ||
| #ifdef __APPLE__ | ||
| // On macOS, pthread_setname_np() can only set the calling thread's name. | ||
| ret = pthread_setname_np(buf); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It seems (from the man page) that macOS doesn't have the 16-character limitation. Could we pass the original buffer here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if _HAVE_THREAD_NATIVE_ID: | ||
| self._set_native_id() | ||
| if _HAVE_SET_THREAD_NAME: | ||
| _set_thread_name(self.name) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't work well for platforms with the 16-character limitation.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
New attempt to implement this feature: #127338 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
#127338 was merged instead. Thanks for your contribution anyway! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.