multithreading-problem

Diez B. Roggisch deets_noospaam at web.de
Sun Jul 27 16:29:52 EDT 2003


Manish Jethani wrote:

>> 
>> Placing a time.sleep(3) after the thread.start() fixed things. So it
>> appears that the curried lambda passed as target is somehow a reference
>> equal for all four invocations.
> 
> No, I don't believe it to be true.  It's probably just that the
> other threads aren't getting a chance to run.  Consider
> time.sleep(0) in the while loop in work()

No, they all run - just a few of them have the same parameters. In my real
app, all of them do some work, which takes an individual amount of time. In
the main-thread I wait for all of them to be terminated, and while doing
that print how much are still running. All this works as expected. The only
thing not working is the parameter passing.

Diez




More information about the Python-list mailing list