Message377328
> And what if run different threads with the same target or with different targets with the same name?
If multiple Thread objects using the same target (or different targets with the same name), they all get the same name using my PR 22357.
> Would not "Thread-3" be more useful in this case?
Well, that's an open question. In my experience, "Thread" name is pretty useless.
What if I modify my PR to add "-{counter}" (ex: "func-3" for target.__name__="func") to the default name? Reuse _counter().
Pseudo-code:
self._name = str(name)
try:
base_name = target.__name__
except AttributeError:
base_name = "Thread"
if not self._name:
self._name = "{base_name)-{_counter()}" |
|
Date |
User |
Action |
Args |
2020-09-22 14:32:03 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka |
2020-09-22 14:32:03 | vstinner | set | messageid: <1600785123.31.0.664198699481.issue41833@roundup.psfhosted.org> |
2020-09-22 14:32:03 | vstinner | link | issue41833 messages |
2020-09-22 14:32:03 | vstinner | create | |
|