NewBie Doubt in Python Thread Programming

James Mills prologic at shortcircuit.net.au
Wed May 11 03:34:10 EDT 2011


On Wed, May 11, 2011 at 4:57 PM, vijay swaminathan <swavijay at gmail.com> wrote:

[...]

> 1. How the total active thread is 2?

Your threads are terminating as normal.
Without some kind of loop in your run() method
they will execute the instructions and terminate.

> 2. how do I stop a thread? does it get automatically stopped after execution

Usually by a flag or condition that terminates your run() function/method.

> 3. Am I totally wrong in understanding the concepts.
> 4. what is the difference between active_count() and activeCount() since
> both seem to give the same result.

They are synonyms.

> 5. is there a way to find out if the thread is still active or dead?

See: pydoc threading.Thread or help(threading.Thread)

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list