[issue36084] Threading: add builtin TID attribute to Thread objects

2019-11-07 Thread STINNER Victor
STINNER Victor added the comment: Jake created bpo-38707. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-11-05 Thread Jake Tesler
Change by Jake Tesler : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-11-04 Thread STINNER Victor
STINNER Victor added the comment: > I have encountered a minor bug with this new feature. Please open a new issue. -- ___ Python tracker ___ _

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-10-31 Thread Jake Tesler
Jake Tesler added the comment: I have encountered a minor bug with this new feature. The bug occurs when creating a new multiprocessing.Process object on Unix (or on any platform where the multiprocessing start_method is 'fork' or 'forkserver'). When creating a new process via fork, the Nati

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-07-30 Thread miss-islington
miss-islington added the comment: New changeset 7026737d77836657c3b713000c3154cfdb7451db by Miss Islington (bot) in branch '3.8': bpo-36084: Add threading Native ID information to What's New documentation (GH-14845) https://github.com/python/cpython/commit/7026737d77836657c3b713000c3154cfdb7

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-07-30 Thread miss-islington
Change by miss-islington : -- pull_requests: +14787 pull_request: https://github.com/python/cpython/pull/15028 ___ Python tracker ___ __

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-07-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 84846b0187919551b1b08dca447658b710b1 by Victor Stinner (Jake Tesler) in branch 'master': bpo-36084: Add threading Native ID information to What's New documentation (GH-14845) https://github.com/python/cpython/commit/84846b0187919551b1b08dca

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-07-18 Thread Jake Tesler
Change by Jake Tesler : -- pull_requests: +14636 pull_request: https://github.com/python/cpython/pull/14845 ___ Python tracker ___ _

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-29 Thread David Carlier
Change by David Carlier : -- pull_requests: +13548 pull_request: https://github.com/python/cpython/pull/13654 ___ Python tracker ___ ___

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-25 Thread Michael Felt
Michael Felt added the comment: On 23/05/2019 18:16, Jake Tesler wrote: > Jake Tesler added the comment: > > Michael Felt - > If you would like some help with adding/building AIX support for this > functionality, tag me, I'd be glad to help out! :) > > -- Thanks - I'll try to look at

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-23 Thread STINNER Victor
STINNER Victor added the comment: If someone wants to document that _start_new_thread() return value is similar to threading.get_ident() but not threading.get_native_id(): please go ahead and propose a PR :-) Adding support for AIX to get_native_id() should be done in a separated issue sinc

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-23 Thread Jake Tesler
Jake Tesler added the comment: Michael Felt - If you would like some help with adding/building AIX support for this functionality, tag me, I'd be glad to help out! :) -- ___ Python tracker _

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Michael Felt
Michael Felt added the comment: On 22/05/2019 18:08, STINNER Victor wrote: > STINNER Victor added the comment: > > Michael Felt: it's annoying when you ignore Antoine's comment and my comment. > * https://github.com/python/cpython/pull/13463#issuecomment-494797084 > * https://bugs.python.org/i

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Jake Tesler
Jake Tesler added the comment: Victor – the return value of _start_new_thread is the the `ident` parameter, and its not the same as the native id. See here: https://github.com/python/cpython/pull/11993#issuecomment-491544908 -- ___ Python tracker

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread STINNER Victor
STINNER Victor added the comment: Michael Felt: it's annoying when you ignore Antoine's comment and my comment. * https://github.com/python/cpython/pull/13463#issuecomment-494797084 * https://bugs.python.org/issue36084#msg343159 The AIX case is very special and required a separated issue. Plea

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Michael Felt
Michael Felt added the comment: On 22/05/2019 15:15, Jake Tesler wrote: > Jake Tesler added the comment: > > I will look into whether adding thread_self() for AIX would be simple enough > for this PR. > > -- > > ___ > Python tracker >

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread STINNER Victor
STINNER Victor added the comment: glibc 2.30 scheduled in August 2019 will finally provide a gettid() function! * https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD * http://man7.org/linux/man-pages/man2/gettid.2.html Once it will be released, it would be interesting to use it

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread STINNER Victor
STINNER Victor added the comment: Currently, Threading.start() ignores _start_new_thread() return value which is an identifier. Is it the same value than threading.get_native_id()? It might be good to clarify _thread._start_new_thread() documentation since we now have 2 kinds of "identifier"

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset b121f63155d8e3c7c42ab6122e36eaf7f5e9f7f5 by Victor Stinner (Jake Tesler) in branch 'master': bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463) https://github.com/python/cpython/commit/b121f63155d8e3c7c42ab6122e36eaf7f5e9f7f5

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Jake Tesler
Jake Tesler added the comment: I will look into whether adding thread_self() for AIX would be simple enough for this PR. -- ___ Python tracker ___ ___

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Jake Tesler
Jake Tesler added the comment: In general, I’ve concluded most ‘editions’ of pthread_self() are not the same value as this feature aims to implement. I’m not familiar enough with AIX to be certain about that platform, though. If there’s an equivalent function in AIX to capture the actual int

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Eryk Sun
Eryk Sun added the comment: > The pthread_self subroutine returns the calling thread's ID. I don't know much about AIX, but according to the docs [1] the kernel thread ID should be thread_self(), which is not the same as pthread_self(). [1]: https://www.ibm.com/support/knowledgecenter/en/ss

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Michael Felt
Michael Felt added the comment: On 22/05/2019 12:22, Michael Felt wrote: > All the other "assurances" are just things that need to be assured. Adding a > -D_XXX to CFLAGS is not all that complex either. Perhaps getting the need for > the flag documented is 'complex'. Now that I think about i

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Michael Felt
Michael Felt added the comment: I do not know if it is that much mode complex. Unless I missed something it seems to be that this bit - needs three lines added after the FREEBSD block - per below: All the other "assurances" are just things that need to be assured. Adding a -D_XXX to CFLAGS

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread STINNER Victor
STINNER Victor added the comment: The AIX case sounds way more complex. I suggest to start without AIX support, since it is already complex enough, and then open a new issue to discuss/implement AIX support, once this issue is done. -- ___ Python tr

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-22 Thread Michael Felt
Michael Felt added the comment: Repeating a bot of what I added to PR13463 AIX has native support for thread-id since at least AIX 4.1 (1994-1995) where every process has an initial TID (PID are even numbers and "own" the resources, TID are odd and are the "workers" - very simply put). Hence

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread Jake Tesler
Jake Tesler added the comment: Victor Stinner: would you mind taking a look at the new PR? Is this more along the lines of what you had in mind? -- ___ Python tracker ___ ___

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread Jake Tesler
Jake Tesler added the comment: New PR created with requested edits. :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread Jake Tesler
Change by Jake Tesler : -- pull_requests: +13373 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread Jake Tesler
Jake Tesler added the comment: I will implement these changes - let’s try to hit that end-of-month target! -- ___ Python tracker ___ ___

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Jake, would you like to submit a new PR that implements Victor's suggestion (i.e. only define and test the attribute on supported systems)? -- ___ Python tracker __

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread STINNER Victor
STINNER Victor added the comment: New changeset d12e75734d46ecde588c5de65e6d64146911d20c by Victor Stinner in branch 'master': Revert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" (GH-13458) https://github.com/python/cpython/commit/d12e75734d46ecde588c5de65e6d64146

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread STINNER Victor
STINNER Victor added the comment: Jake Tesler: In the meanwhile, can you please try to rewrite your change to make the attribute optional? C PyThread_get_thread_native_id() function and Python _thread.get_native_id() should not be defined if it's not supported by the platform. I suggest to

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 13458 to revert the change which broke the CI for longer than one week, see the rationale there: https://github.com/python/cpython/pull/13458#issuecomment-494334241 Email thread about the regression: https://mail.python.org/pipermail/python-buildbo

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-21 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13368 stage: resolved -> patch review ___ Python tracker ___ ___ Python-bugs-list mail

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-20 Thread STINNER Victor
STINNER Victor added the comment: > So where do we go from here? I propose to only add attribute if it's supported. If nobody comes with a fix, I would prefer to remove the feature to repair the AIX buildbot. -- ___ Python tracker

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-13 Thread Jake Tesler
Jake Tesler added the comment: So where do we go from here? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-13 Thread STINNER Victor
STINNER Victor added the comment: This change broke the AIX buildbot: https://buildbot.python.org/all/#/builders/132/builds/486 == FAIL: test_various_ops (test.test_threading.ThreadTests) --

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-13 Thread STINNER Victor
STINNER Victor added the comment: > """Native integral thread ID of this thread or 0 if it has not been started. > (...) Why not set the attribute to None before a thread starts? It would be more consistent with the the "ident" attribute behavior, no? Extract __repr__(): def __repr__(se

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-13 Thread STINNER Victor
STINNER Victor added the comment: I dislike adding a function which always return 0 when the feature is not supported: unsigned long PyThread_get_thread_native_id(void) { ... #if ... ... #else unsigned long native_id; native_id = 0; #endif return (unsigned long) native_id;

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you Jake for your contribution! -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 4959c33d2555b89b494c678d99be81a65ee864b0 by Antoine Pitrou (Jake Tesler) in branch 'master': bpo-36084: Add native thread ID to threading.Thread objects (GH-11993) https://github.com/python/cpython/commit/4959c33d2555b89b494c678d99be81a65ee864b0

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-10 Thread Jake Tesler
Jake Tesler added the comment: The feature is supported on Windows: the file supporting Windows threading is `thread_nt.h`, not `thread_pthread.h` since Windows doesn't use POSIX-style threads. Also it is different from threading.get_ident() - ident is a Python-issued unique identifier, TID

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-09 Thread STINNER Victor
STINNER Victor added the comment: It seems like the feature is only supported by a few operating systems and only if required functions are available: #ifdef __APPLE__ volatile uint64_t tid; pthread_threadid_np(NULL, &tid); #elif defined(__linux__) volatile pid_t tid; tid = sy

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-04-02 Thread Jake Tesler
Jake Tesler added the comment: *bump* Could someone look into reviewing this bug/PR? Thanks! -- ___ Python tracker ___ ___ Python-

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-02-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-02-22 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12016 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue36084] Threading: add builtin TID attribute to Thread objects

2019-02-22 Thread Jake Tesler
New submission from Jake Tesler : This functionality adds a native Thread ID to threading.Thread objects. This ID (TID), similar to the PID of a process, is assigned by the OS (kernel) and is generally used for externally monitoring resources consumed by the running thread (or process). This