How to determine if threads are active in an application?

Gabriel Genellina gagsl-py2 at
Tue Mar 9 07:03:36 CET 2010

En Fri, 26 Feb 2010 19:10:30 -0300, <python at> escribió:

> Is there technique to determine if threads are active in a Python
> application?
> The only technique I can think of is to check sys.modules for
> thread and threading. But this will only show whether these
> modules were imported - not whether there are actually background
> threads running.

I've just read your post.
Look at threading.activeCount() - this returns only those threads created  
using the threading module. If that's not enough, you'll have to use some  
OS-specific functions.

Gabriel Genellina

More information about the Python-list mailing list