[Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Tue May 31 10:37:15 CEST 2011
- Previous message: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to
- Next message: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2011/5/31 Charles-François Natali <neologix at free.fr>:
+.. function:: getident() + + Return the 'thread identifier' of the current thread. This is a nonzero + integer. Its value has no direct meaning; it is intended as a magic cookie + to be used e.g. to index a dictionary of thread-specific data. Thread + identifiers may be recycled when a thread exits and another thread is + created.
That's not quite true - the Thread id isn't relinquished until the Thread object itself is destroyed, rather than when the underlying thread finishes execution (i.e. the lifecycle of athread.ident is the same as that of id(athread)). I'm not sure I understand, Nick.
I was just wrong, but the wording is still confusing since it has been copied from _thread.ident. "Thread" means something other than "threading.Thread" in that module, while in the threading docs, it typically refers to the actual objects. With the change of module, there needs to be something to make it clearer that this is information related to os level threads.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to
- Next message: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]