Ritesh Raj Sarraf wrote:
> 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

Another thing you might want to consider would be to split your
download and zipping code into separate functions then create one more
thread to do all the zipping.  That way your downloading threads would
never be waiting around for each other to zip.


Just a thought.  :)
~Simon

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to