Thread Question

Ritesh Raj Sarraf rrs at researchut.com
Sat Aug 5 14:56:05 EDT 2006


Bryan Olson on Saturday 05 Aug 2006 23:56 wrote:

> You don't want "ziplock = threading.Lock()" in the body of
> the function. It creates a new and different lock on every
> execution. Your threads are all acquiring different locks.
> To coordinate your threads, they need to be using the same
> lock.
> 
> Try moving "ziplock = threading.Lock()" out of the function, so
> your code might read, in part:
> 
> 
> ziplock = threading.Lock()
> 
> def run(request, response, func=copy_first_match):
> # And so on...

Thanks. That did it. :-)

Ritesh
-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
"Stealing logic from one person is plagiarism, stealing from many is research."
"The great are those who achieve the impossible, the petty are those who
cannot - rrs"




More information about the Python-list mailing list