[Python-Dev] Add function to signal module for getting main thread id

Antoine Pitrou solipsis at pitrou.net
Fri Aug 30 11:43:20 CEST 2013

Le Fri, 30 Aug 2013 11:36:57 +0200,
Victor Stinner <victor.stinner at gmail.com> a écrit :
> If we expose the identifier of the main thread, something should be
> added to the threading module, not the signal module.


> Is it possible that the main thread exit while there are still other
> live threads?

"exit" in what sense? In the C sense, no: when the main C thread
exits, the whole process is terminated (this is how our "daemon threads"

In the Python sense, yes: we have a test for it:



More information about the Python-Dev mailing list