Lets Talk More Threads

Alexander K ak42 at altavista.com
Thu Oct 19 15:23:27 EDT 2000


hmm, you sure about that?
a quote from the 2.0 docs for 'threading':
"""
start () 
    Start the thread's activity. 

    This must be called at most once per thread object. It
arranges for the object's run() method to be invoked in a
separate
    thread of control. 
"""

it says 'at most once', no? :)

  / ak


Alex McHale wrote:
> 
> Ok,
>   Using the Thread class, which I'm extremely happy with, I've run into a
> problem.  The documentation on the class suggests that you can obj.start( )
> a thread multiple times.  Yet, when I do this, I get an error to the effect
> of "thread already started"
> What I'm needing to do is have a thread which I can resurrect over and over.
> 
> This isn't the code I'm dealing with, but it is a simple parallel (abstract,
> no imports, etc)
> 
> actions = myThread( )
> actions.start( )
> while actions.isAlive( ):
>   sleep(10)
> if not actions.isAlive( ):     # this is only to emphasize that
> ctions.run( ) has indeed finished
>   actions.start( )
> 
> and this gives the above style error, every time.  Am I missing something
> here?

-- 
.
.
... ~~~:[ com dot altavista at ak42 ]:~~~ ...



More information about the Python-list mailing list