How to determine if threads are active in an application?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Mar 9 01:03:36 EST 2010


En 2010年2月26日 19:10:30 -0300, <python at bdurham.com> 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

AltStyle によって変換されたページ (->オリジナル) /